Rethinking the futex API
Rethinking the futex API
Posted Jun 19, 2020 9:58 UTC (Fri) by bno1 (guest, #138051)In reply to: Rethinking the futex API by ras
Parent article: Rethinking the futex API
>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.
Wine already has this. The esync patchset uses eventfd to wait on multiple winapi mutexes [1]. But some Windows programs run out of file descriptors because they leak mutexes. File descriptors are a much more limited resource than memory. Also, the patch for wait for multiple futexes (called fsync in the wine community) has slightly better performance [2].
[1] https://github.com/zfigura/wine/blob/esync/README.esync
[2] https://github.com/ValveSoftware/Proton/issues/2966
