|
|
Log in / Subscribe / Register

A new futex API

A new futex API

Posted Aug 15, 2023 4:38 UTC (Tue) by alison (subscriber, #63752)
Parent article: A new futex API

Hopefully the ability to specify 8- and 16-bit futexes is a step to addressing the problems described in the 2016 talk Real-Time Summit 2016 meeting called "Futexes are cursed" (https://wiki.linuxfoundation.org/_media/realtime/events/r...) and the similarly themed next presentation called "Pthread Condvars: Posix Compliance and the PI Gap" (https://wiki.linuxfoundation.org/_media/realtime/events/r...). The conclusion then was there was not enough space in the existing futex either to entirely eliminate out-of-order wakeups or to implement priority inheritance. Letting userspace choose the size of futexes is great, as that means that embedded control systems should (eventually) be able to have PI and giant systems can still have many, many simultaneous futexes.

There's still the question of what libpthread will choose, but there are alternatives there as well (https://ossna2020.sched.com/event/cZIe/librtpi-conditiona...).


to post comments

A new futex API

Posted Aug 15, 2023 18:35 UTC (Tue) by ghodgkins (subscriber, #157257) [Link] (1 responses)

What were the problems described in "Futexes are evil"? The linked slide deck isn't very informative.

A new futex API

Posted Aug 16, 2023 4:57 UTC (Wed) by alison (subscriber, #63752) [Link]

The videos are here: https://www.youtube.com/playlist?list=PLbzoR-pLrL6oauKOYM...

"Futexes are cursed" as I recall was basically about the difficulty of fixing them in the kernel, and "Pthread Condvars" was about the difficulty of fixing them in glibc. Problems, as described by the reliably excellent LWN article, were false (misordered) wakeups and no ability to implement priority inheritance. The root cause is too fee bits to indicate state, as is so often the case for older APIs. Recently I have thought that it's too bad that the kernel chose not to break the futex() ABI at the same time it essentially forced distros to switch to 64-bit time.


Copyright © 2026, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds