On Wed, 25 Feb 2015 10:42:23 -0500 Ben Darnell <b...@bendarnell.com> wrote: > > Maybe we should modify asyncio.Queue and asyncio.Lock to make them > > thread-safe? > > > > -1 on modifying asyncio.Lock. You can use a threading.Lock in an asyncio > program to protect data that is used by other threads (and if you're > concerned about blocking, make your critical sections smaller).
That will stop all coroutines, though, not only the one waiting for the lock. (not that I think trying to synchronize between threads and coroutines is a terrific idea) Regards Antoine.