generators shared among threads

Paul Rubin http
Tue Mar 7 21:17:31 EST 2006


jess.austin at gmail.com writes:
> The main problem with this is that the yield leaves the lock locked.
> If any other thread wants to read the generator it will block. 

Ouch, good catch.  Do you see a good fix other than try/finally?
Is there a classical way to do it with coroutines and semaphores?



More information about the Python-list mailing list