Python threading (was: Re: global interpreter lock not working as it should)

anton wilson anton.wilson at camotion.com
Tue Aug 6 18:05:19 EDT 2002


On Tuesday 06 August 2002 02:45 pm, Tim Peters wrote:
> [Armin Steinhoff]
>
> > No ... only the first thread in the waiting queue get the state
> > 'runnable'! You have probably pthread_cond_broadcast in mind ....
>
> No.  Read the spec:
>
> <http://www.opengroup.org/onlinepubs/007904975/functions/pthread_cond_signa
>l .html>
>
> If the meaning of "at least one" in
>
>     The pthread_cond_signal() function shall unblock at least one of the
>     threads that are blocked on the specified condition variable cond (if
>     any threads are blocked on cond).
>
> isn't clear to you, the Rationale at the bottom explains it at some length.


This is true. I tested on my system, and sometimes it made one, sometimes two 
runnable.

Anton




More information about the Python-list mailing list