cats-effect icon indicating copy to clipboard operation
cats-effect copied to clipboard

Add best-effort stealing API to `PollingSystem`

Open armanbilge opened this issue 1 year ago • 2 comments
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.

armanbilge avatar Aug 06 '24 20:08 armanbilge