aiotools icon indicating copy to clipboard operation
aiotools copied to clipboard

New module: sync

Open achimnol opened this issue 8 years ago • 0 comments

Add a new module called "sync" which provides a set of high-level synchronization primitives not offered in the standard library.

My first idea is AsyncBarrier: when all coroutines that share the same barrier object calls wait(), then they are all blocked until all of them calls wait(). If all has called wait(), resume their execution. Preferably, the API should look like threading.Barrier. Let's also write test suites for it.

Ideas for other synchronization primitives are welcome.

achimnol avatar Aug 14 '17 06:08 achimnol