eio icon indicating copy to clipboard operation
eio copied to clipboard

Make Waiters lock-free

Open talex5 opened this issue 1 year ago • 3 comments

Waiters currently needs a mutex to protect the list of waiting fibers. This prevents us from using it in signal handlers or GC finalizers (see #374). We can't use Lf_queue here because we need to support cancellation (removing waiters from the middle of the queue).

https://arxiv.org/pdf/2111.12682.pdf ("A formally-verified framework for fair synchronization in Kotlin coroutines") could be a good solution, and will probably be faster too.

talex5 avatar Dec 05 '22 17:12 talex5