Rethinking the futex API
Rethinking the futex API
Posted Jun 18, 2020 23:31 UTC (Thu) by ras (subscriber, #33059)Parent article: Rethinking the futex API
Here I see a whole pile of candy that has nothing to do "keep it simple and fast". It can all be done with judicious combination of libatomic , a simple futex and some data structure in shared memory, wrapped in a userspace library because can be difficult to get right. Why someone would need something other than 32 bits is beyond me. Waiting on multiple values can be done in user space. Association with a fd can be done with a userspace library writing a byte to a fifo on wakeup. The thundering herd is already avoided by waking up a limited number of sleepers.
