Results 1 to 3 of 3

Thread: multithreading

  1. #1
    Join Date
    Jan 2006
    Posts
    976
    Thanks
    53
    Qt products
    Qt3
    Platforms
    Windows

    Default multithreading

    Hello,
    I need to do this (and I thought to do with thread):
    I have one class myClass that do some computations with one result; but the result can be different time by time (because it depends by some random value variabile assigned when the class is created). So I need to create, eg. 5 instances of myClass, do the computations, and take the best result! I'd like that the computations of that class finish at the same time (I mean, I don't want do this in sequence). I hope this will be clear. Is this a problem that must be cope with multithread? If yes, what's the header to use for multithread? I read <window.h>, but I dont' trust to it...
    (I have to use c++ standard and not other library like QT)

    thanks
    Regards

  2. #2
    Join Date
    Jan 2006
    Location
    Bremen, Germany
    Posts
    554
    Thanked 86 Times in 81 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: multithreading

    Implementing threads with pure WinAPI isn't really a nice way. I really suggest using QThread.

    /edit: And if you really want to do Thread Programming with WinAPI, search for 'CreateThread' at msdn.microsoft.com

  3. #3
    Join Date
    May 2008
    Posts
    8
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: multithreading

    Google for OpenMP. GCC 4.3 supports it, I think. If it doesn't, you can get replacement GCC libraries that do support it here.

Similar Threads

  1. Replies: 2
    Last Post: 21st February 2008, 22:35
  2. Multithreading problem
    By y.shan in forum Qt Programming
    Replies: 4
    Last Post: 13th December 2007, 12:21
  3. D-Bus in Multithreading environment
    By mdecandia in forum Qt Programming
    Replies: 0
    Last Post: 15th March 2007, 16:36
  4. MultiThreading in Qt
    By manivannan_1984 in forum Qt Programming
    Replies: 7
    Last Post: 7th November 2006, 19:26
  5. MultiThreading n Qhttp
    By Shambhavi in forum Qt Programming
    Replies: 1
    Last Post: 18th January 2006, 13:36

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.