Results 1 to 3 of 3

Thread: How to set thread priority for QtConcurrent::map

  1. #1
    Join Date
    Dec 2006
    Posts
    426
    Thanks
    8
    Thanked 18 Times in 17 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default How to set thread priority for QtConcurrent::map

    Hi,

    My machine is a single core with QThread::idealThreadCount() = 1

    I made 2 QtConcurrent::map calls. The problem is that the 2nd one doesn't start until the 1st one finished. What can I do to start the 2nd one immediately and let all others yield for it?

    thanks!

  2. #2
    Join Date
    Oct 2011
    Posts
    7
    Qt products
    Qt3 Qt4
    Platforms
    Windows

    Default Re: How to set thread priority for QtConcurrent::map

    Maybe your 1st thread can finish the job within a time slice. Therefore, the 2nd one always starts after the 1st one is finished.
    Actually, on a single core computer, I do not think there is any way to run two threads concurrently.
    The OS always assigns time slices to threads one by one.

  3. #3
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    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: How to set thread priority for QtConcurrent::map

    QtConcurrent doesn't support prioritizing tasks. Once a task is running and the pool of threads is depleted, all other tasks will pend until there is a thread available.
    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. Replies: 5
    Last Post: 6th September 2011, 23:19
  2. QtConcurrent::blocking* thread count
    By ibex in forum Qt Programming
    Replies: 6
    Last Post: 26th January 2011, 12:48
  3. Qt thread priority
    By SailinShoes in forum Qt Programming
    Replies: 1
    Last Post: 16th June 2010, 01:39
  4. Control the priority of QtConcurrent::run()?
    By PolyVox in forum Qt Programming
    Replies: 4
    Last Post: 16th February 2010, 01:14
  5. priority of QThread
    By quickNitin in forum Qt Programming
    Replies: 3
    Last Post: 13th May 2006, 12:53

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.