Results 1 to 20 of 20

Thread: Help me about multithread!

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #5
    Join Date
    Jan 2006
    Location
    Sta. Eugènia de Berga (Vic - Barcelona - Spain)
    Posts
    869
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Thanks
    70
    Thanked 59 Times in 57 Posts

    Default Re: Help me about multithread!

    Hi,
    Why use a thread in such a situation? If the main thread is idle, why not use it to do the other thread's job?
    I supose that "vql" is learnig how to work with threads.

    Qt Code:
    1. int main(int argc, char *argv[])
    2. {
    3. QApplication app(argc, argv);
    4. MyThread *thread = new MyThread;
    5. thread->start();
    6. thread->wait(); //Here the main thread will stop until your thread exits the run method
    7. qWarning("Output this line after thread finished.");
    8. return 1;
    9. }
    To copy to clipboard, switch view to plain text mode 
    Òscar Llarch i Galán

  2. The following user says thank you to ^NyAw^ for this useful post:

    vql (3rd February 2007)

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
  •  
Qt is a trademark of The Qt Company.