Page 2 of 2 FirstFirst 12
Results 21 to 23 of 23

Thread: Multithreading

  1. #21
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,360
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Multithreading

    Quote Originally Posted by havij000 View Post
    Dear wysota,

    as the processing is a time consuming task I prefer to do them in different threads.
    So do exactly that. See that this is not what you said earlier:

    Quote Originally Posted by havij000
    1. recieve thread: receiving data from LAN
    2. process thread: checking and sorting, assemble them and storing packets
    3. ui thread which is the main thread.
    Points 1 and 3 are not related to processing and can thus be done in the same thread. On the other hand if you have 10 tasks to process, queueing them all into a single thread will probably make them process longer than it takes for a next task to flow in. Consider using a pool of threads (e.g. using QtConcurrent::run()) for processing (and processing only).
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  2. #22
    Join Date
    Nov 2012
    Posts
    48
    Thanks
    4
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: Multithreading

    I wrote a multi thread programm but after running for 10 seconds I fase the erro : "The program has unexpectedly finished", "exited with code 0"

    Who can help me?

    Regards,

  3. #23
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,360
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Multithreading

    What do you expect us to do for you?
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


Similar Threads

  1. When to use Multithreading?
    By "BumbleBee" in forum General Programming
    Replies: 5
    Last Post: 30th April 2011, 18:21
  2. QThread for Multithreading
    By strateng in forum Newbie
    Replies: 12
    Last Post: 8th June 2010, 13:32
  3. regarding multithreading
    By mohanakrishnan in forum Qt Programming
    Replies: 19
    Last Post: 9th December 2009, 08:21
  4. multithreading
    By mickey in forum General Programming
    Replies: 2
    Last Post: 5th June 2008, 22:01
  5. MultiThreading in Qt
    By manivannan_1984 in forum Qt Programming
    Replies: 7
    Last Post: 7th November 2006, 19:26

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.