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

Tim Peters tim.one at comcast.net
Tue Aug 6 14:45:59 EDT 2002


[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_signal
.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.





More information about the Python-list mailing list