Chris, this led to an interesting discussion, which then went pretty
far from the original concern.

Perhaps you can share your use-case, both as pseudo-code and a link to
real code.

I'm specifically interested to see why/where you'd like to use a
read-write async lock, to evaluate if this is something common or
specific, and if, perhaps, some other paradigm (like queue, worker
pool, ...) may be more useful in general case.

I'm also curious if a full set of async sync primitives may one day
lead to async monitors. Granted, simple use of async monitor is really
a future/promise, but perhaps there are complex use cases in the
UI/react domain with its promise/stream dichotomy.

Cheers,
d.

On 25 June 2017 at 23:13, Chris Jerdonek <chris.jerdo...@gmail.com> wrote:
> I'm relatively new to async programming in Python and am thinking
> through possibilities for doing "read-write" synchronization.
>
> I'm using asyncio, and the synchronization primitives that asyncio
> exposes are relatively simple [1]. Have options for async read-write
> synchronization already been discussed in any detail?
>
> I'm interested in designs where "readers" don't need to acquire a lock
> -- only writers. It seems like one way to deal with the main race
> condition I see that comes up would be to use loop.time(). Does that
> ring a bell, or might there be a much simpler way?
>
> Thanks,
> --Chris
>
>
> [1] https://docs.python.org/3/library/asyncio-sync.html
> _______________________________________________
> Async-sig mailing list
> Async-sig@python.org
> https://mail.python.org/mailman/listinfo/async-sig
> Code of Conduct: https://www.python.org/psf/codeofconduct/
_______________________________________________
Async-sig mailing list
Async-sig@python.org
https://mail.python.org/mailman/listinfo/async-sig
Code of Conduct: https://www.python.org/psf/codeofconduct/

Reply via email to