-
Notifications
You must be signed in to change notification settings - Fork 11.1k
Kick sharding is unsafe #38
Copy link
Copy link
Closed
Description
iomgr currently uses a sharding mechanism where multiple pollsets may share kick-pipes.
This is unsafe: consider two threads with two separate pollsets sharing a kick pipe. The first thread is polling on pollset A. The second thread is about to poll on pollset B. A third thread tries to kick pollset B. That wakes up the first thread, which drains the pipe. Now thread 2 enters poll and never sees the wakeup.
It is possible to avoid this in principle by ensuring only the target of the wakeup does the drain, but we're probably better off just freelisting and dynamically assigning kick pipes to begin with.
Reactions are currently unavailable