cats-effect
cats-effect copied to clipboard
Add best-effort stealing API to `PollingSystem`
trafficstars
Closes https://github.com/typelevel/cats-effect/issues/4008.
I sketched out a possible stealing implementation for Selector along with a test but ended up reverting it because it's not possible to threadsafely interact with the selected keys set (without relying on synchronization, but this could mean the stealing thread being blocked indefinitely if the owner thread happens to be polling concurrently).
Since we don't support multi-threading on Native yet, stealing for epoll/kqueue is implemented as no-op for now. I will investigate if we can implement stealing for those systems later on.
I'm still optimistic that we can support stealing for io_uring.