2015-02-25 16:23 GMT+01:00 Andrew Svetlov <andrew.svet...@gmail.com>:
> I'm OK with current asyncio locks and queue implementation, they are
> not-threadsafe by design explicitly.

Ok, it expected this answer. It is a more a documentation issue than a
design issue :-)

> For locks you can use `yield from lock.acquire()` (requires nested
> function definition for passing into `loop.call_soon_threadsafe()`)
> and `lock.release()`.

If you use a nested function and call_soon_threadsafe(), you can use
"with (yield from lock):".

I will add "This class is not thread safe." to all lock classes.

But it would help to have a short examples showing how to:
- share a queue between multiple coroutines
- use a lock in coroutines

And maybe also examples with multiple threads:

- "share" a queue between multiple coroutines running in different
threads (in different event loops)

Victor

Reply via email to