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

anton wilson anton.wilson at
Mon Aug 5 19:57:23 EDT 2002

> I had it in my head that, when the timer interrupt for the timeslice fires,
> thread B wouldn't be runnable because it's waiting on the GIL. But of
> course it *is* runnable because it's not waiting on the GIL, it's waiting
> on a condition saying that the GIL has been released sometime in the past.
> If it was waiting on the GIL then the timer interrupt would do nothing and
> when A hit the next release-reacquire point the scheduler would see that A
> had gone past the end of it's timeslice and could switch to the
> now-runnable B.

well, i don't really think it's runnable, becuase the system call used by 
pthread_cond_wait takes it off the run-queue until a signal is delivered.


More information about the Python-list mailing list