generators shared among threads

Paul Rubin http
Wed Mar 8 03:17:31 CET 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