Jump to content

Futex

From Wikipedia, the free encyclopedia

This is an old revision of this page, as edited by 64.254.110.34 (talk) at 20:59, 14 November 2005 (Added all co-authors of the ''fuss, futexes and furwocks: Fast Userlevel Locking in Linux'' paper.). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

A futex (short for "fast userspace mutex") is a basic tool to realize locking and building higher-level locking abstractions such as semaphores and POSIX mutexes on Linux. They first appeared in the development kernel version 2.5.7; the semantics stabilized as of version 2.5.40, and they are present in the 2.6.x stable kernel series.

Futexes were created by Hubertus Franke (IBM Thomas J. Watson Research Center), Matthew Kirkwood, Ingo Molnar (Red Hat) and Rusty Russell (IBM Linux Technology Center).

A futex consists of a piece of memory (an aligned integer) that can be shared between processes; it can be incremented and decremented by atomic assembler instructions, and processes can wait for the value to become positive. Futex operations are done almost entirely in userspace; the kernel is only involved when a contended case needs to be arbitrated. This allows locking primitives implementing used futexes to be very efficient: since most operations do not require arbitration between processes, most operations can be performed without needing to perform a (relatively expensive) system call.

See also

References