ocaml-multicore / picos

Interoperable effects based concurrency
https://ocaml-multicore.github.io/picos/doc/picos/index.html
ISC License
86 stars 3 forks source link

Add `Awaitable` atomic locations #314

Closed polytypic closed 3 days ago

polytypic commented 1 week ago

This PR adds a futex-like awaitable atomic location abstraction. This can be useful for implementing various kinds of synchronization and communication primitives. For example, it can be used to implement mutexes and condition variables with good performance. Below shows the speed up obtained by replacing the fair mutex and condition with unfair mutex and condition implemented using the awaitable abstraction:

Screenshot 2024-10-21 at 20 19 14