[Qt-interest] Multithreading - yield function
Bradley T. Hughes
bradley.hughes at nokia.com
Wed Sep 2 11:00:00 CEST 2009
Thomas Dähling wrote:
> 2009/9/1 Patric <userqt at gmail.com>:
>
>> you are telling me that if I have two threads that are running, I really
>> don't know when the second one will start executing in the middle of the
>> code ? And stop also.
>
> This sums it up pretty much, yes. Using threads means your program
> flow is now asynchronous, which in turn means that you cannot rely
> upon a specific order of thread execution (see
> http://en.wikipedia.org/wiki/Scheduling_(computing) for some basic
> information). What you can do, however, is provide QWaitConditions or
> other locking mechanisms to ensure that one thread will wait for
> another, if needed.
I recall a presentation given by a colleague of mine at DevDays a few years
back... essentially, introducing threads into your application makes the
entire thing non-deterministic :P
</offtopic>
--
Bradley T. Hughes (Nokia-D-Qt/Oslo), bradley.hughes at nokia.com
Sandakervn. 116, P.O. Box 4332 Nydalen, 0402 Oslo, Norway
More information about the Qt-interest-old
mailing list