Results 1 to 11 of 11

Thread: Multi-thread vs. Multicore

  1. #1
    Join Date
    May 2007
    Posts
    90
    Thanks
    40
    Qt products
    Qt4
    Platforms
    Windows

    Default Multi-thread vs. Multicore

    Does the Qt4 multi-thread structure actually take advantage of multiple cores on the same machine? I have noticed that when running a multi-threaded application on Windows vs. Solaris, the processor usage caps at 50% for a dual-core machine on windows, but 100% on Solaris.

  2. #2
    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: Multi-thread vs. Multicore

    From the application point of view multi-core CPU is visible as two different processing units, so the only difference between using two threaded application on dual-core and dual-cpu is caused by the architecture of the cpu itself and the data flow in the application (of course dual-core will be slower due to smaller computing power per core).

    Don't compare processor usage on different systems. Compare execution times instead. In your case I'd say something is wrong with your program or system settings and Windows executes your application on a single core (thus 50% instead of 100%).

  3. The following user says thank you to wysota for this useful post:

    TheGrimace (20th September 2007)

  4. #3
    Join Date
    Feb 2006
    Location
    Romania
    Posts
    2,744
    Thanks
    8
    Thanked 541 Times in 521 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Multi-thread vs. Multicore

    Quote Originally Posted by wysota View Post
    From the application point of view multi-core CPU is visible as two different processing units, so the only difference between using two threaded application on dual-core and dual-cpu is caused by the architecture of the cpu itself and the data flow in the application (of course dual-core will be slower due to smaller computing power per core).

    Don't compare processor usage on different systems. Compare execution times instead. In your case I'd say something is wrong with your program or system settings and Windows executes your application on a single core (thus 50% instead of 100%).
    Goddamn it. You always get the best threads...
    But yes, I'd also say win is running on a single core. Have you tried changing the process affinity from task manager?
    Vista runs multiple threads on both cores by default.

  5. The following user says thank you to marcel for this useful post:

    TheGrimace (20th September 2007)

  6. #4
    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: Multi-thread vs. Multicore

    Quote Originally Posted by marcel View Post
    Goddamn it. You always get the best threads...
    Sorry But I have to admit, I have a handicap because of an experimental plugin running for priviledged users on the forum.

  7. #5
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: Multi-thread vs. Multicore

    Quote Originally Posted by wysota View Post
    But I have to admit, I have a handicap because of an experimental plugin running for priviledged users on the forum.
    What?! Now you really made us curious about it!
    J-P Nurmi

  8. #6
    Join Date
    Feb 2007
    Location
    Italy
    Posts
    69
    Thanks
    12
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: Multi-thread vs. Multicore

    Quote Originally Posted by TheGrimace View Post
    Does the Qt4 multi-thread structure actually take advantage of multiple cores on the same machine?
    It's not matter of qt, it's matter of OS' scheduler. Multi thread means that application is *designed* to have pieces of code which are executed in parallel. How it's executed is not (shouldn't be) qt's interest.

  9. #7
    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: Multi-thread vs. Multicore

    Quote Originally Posted by jpn View Post
    What?! Now you really made us curious about it!
    Nothing special. Just a quicker way to access new posts.

  10. #8
    Join Date
    Feb 2006
    Location
    Romania
    Posts
    2,744
    Thanks
    8
    Thanked 541 Times in 521 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Multi-thread vs. Multicore

    Yeah, well if it is something that notifies you in real time that new posts/threads have appeared them we all should have that .

  11. #9
    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: Multi-thread vs. Multicore

    Quote Originally Posted by marcel View Post
    Yeah, well if it is something that notifies you in real time that new posts/threads have appeared them we all should have that .
    No, but there is this button labeled "Hide New Posts from JPN and Marcel".

  12. #10
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: Multi-thread vs. Multicore

    Look who's got all the bells and whistles! Wysota, so you wrote the automated answering bot too, right? 6.5k posts is no more a wonder!
    J-P Nurmi

  13. #11
    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: Multi-thread vs. Multicore

    Quote Originally Posted by jpn View Post
    Look who's got all the bells and whistles! Wysota, so you wrote the automated answering bot too, right? 6.5k posts is no more a wonder!
    Basically I ask half of the questions myself. Thanks to that I know how to answer them. And offtopic discussions such as this one also help in increasing post count quickly. I prefer flame wars though...

Similar Threads

  1. KDE/QWT doubt on debian sarge
    By hildebrand in forum KDE Forum
    Replies: 13
    Last Post: 25th April 2007, 06:13
  2. Replies: 10
    Last Post: 20th March 2007, 22:19
  3. Problem closing a QMainWindow in Qt4.2
    By ian in forum Qt Programming
    Replies: 11
    Last Post: 17th October 2006, 00:49
  4. Multi thread problem
    By sreedhar in forum Qt Programming
    Replies: 5
    Last Post: 26th June 2006, 13:33
  5. [QT4] QThread and printing a QList<QPixmap>
    By KShots in forum Qt Programming
    Replies: 3
    Last Post: 24th April 2006, 21:44

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.