[Qt-interest] Multithreading - yield function
Patric
userqt at gmail.com
Tue Sep 1 12:43:10 CEST 2009
Perfectly clear.
Patric
----- Original Message -----
From: "Sean Harmer" <sean.harmer at maps-technology.com>
To: <qt-interest at trolltech.com>
Sent: Tuesday, September 01, 2009 1:15 PM
Subject: Re: [Qt-interest] Multithreading - yield function
> On Tuesday 01 Sep 2009 10:58:23 Patric wrote:
>> Hi, msleep(1) is doing what yield should do from my point of view.
>> Very tricky, though...
> No. msleep(1) is just making that thread go to sleep. It just so happens
> that
> 1ms is ages for modern CPUs and so the kernel decides to switch context to
> another thread/application rather than wasting a whole ms of CPU time.
>
> The yield function just says to the kernel "you can do a context switch if
> you
> like but I am not going to force you".
>
> Is that clear?
>
> Sean
> _______________________________________________
> Qt-interest mailing list
> Qt-interest at trolltech.com
> http://lists.trolltech.com/mailman/listinfo/qt-interest
>
More information about the Qt-interest-old
mailing list