Rethinking the futex API
Rethinking the futex API
Posted Jun 20, 2020 2:54 UTC (Sat) by krisman (subscriber, #102057)In reply to: Rethinking the futex API by itsmycpu
Parent article: Rethinking the futex API
> When necessary, you associate a list of consumers with each event producer, each list entry containing
> a pointer to the waiters futex and/or atomic guard variable.
> a pointer to the waiters futex and/or atomic guard variable.
So, your design has one futex per consumer. This means that when a producer signals, in order to wake all of the entries in its waitqueue, it walks the list and does a FUTEX_WAKE syscall per entry. That's much worse than FWM.
