Author: Tony Werten
Date: 01:55:31 12/01/03
Go up one level in this thread
On December 01, 2003 at 04:50:20, Andreas Guettinger wrote:
>On December 01, 2003 at 02:41:28, Tony Werten wrote:
>
>>When my masterthread is spinning, waiting for results from it's workers threads,
>>how do I keep it from burning CPU time ?
>>
>>The apifunction sleep() doesn't some threadsafe, suspending the thread and
>>having it resumed by the worker seems overly complicated. ( Accept maybe if I
>>can use a callback function )
>>
>>Any thoughts ?
>>
>>Tony
>
>Isn't that what condition variables are for?
Yes, but the looping costs processor time. I want to get rid of that.
Preferably:
While (no_results) do request('Dear mr Operating System. Don't spend any time on
me since I'm not doing anything usefull anyway. Please spend the remaining of
this timeslice on my workers since I can't do anything until they are finished.
Your's truly, Main Thread' :)
Tony
>
>regards
>Andy
This page took 0 seconds to execute
Last modified: Thu, 15 Apr 21 08:11:13 -0700
Current Computer Chess Club Forums at Talkchess. This site by Sean Mintz.