|
A futex (short for "fast userspace mutex") is a basic tool to implement 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. Mutual exclusion (often abbreviated to mutex) algorithms are used in concurrent programming to avoid the simultaneous use of un-shareable resources by pieces of computer code called critical sections. ...
In software engineering, a lock is a mechanism for enforcing limits on access to a resource in an environment where there are many threads of execution. ...
This article is about the computer science application of mutual exclusion. ...
POSIX or Portable Operating System Interface[1] is the collective name of a family of related standards specified by the IEEE to define the application programming interface (API) for software compatible with variants of the Unix operating system. ...
The Linux kernel is a Unix-like operating system kernel. ...
Futexes were created by Hubertus Franke (IBM Thomas J. Watson Research Center), Matthew Kirkwood, Ingo Molnár (Red Hat) and Rusty Russell (IBM Linux Technology Center). For other uses, see IBM (disambiguation) and Big Blue. ...
The Thomas J. Watson Research Center is the headquarters for the IBM Research Division. ...
The introduction to this article provides insufficient context for those unfamiliar with the subject matter. ...
For other uses, see Red Hat (disambiguation). ...
Paul Rusty Russell, employed by IBMs Linux Technology Center and a technical member of OzLabs, is an Australian Linux kernel hacker. ...
A futex consists of a piece of memory (an aligned integer) that can be shared among 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 requires arbitration. This allows locking primitives implemented using 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. This article does not cite any references or sources. ...
Not to be confused with Natural number. ...
In computing, a process is, roughly speaking, a task being run by a computer, often simultaneously with many other tasks. ...
In computer science, an atomic operation is an operation during which a processor can simultaneously read a location and write it in the same bus operation. ...
An assembly language is a low-level language for programming computers. ...
An operating system usually segregates the available system memory into kernel space and user space. ...
A kernel connects the application software to the hardware of a computer. ...
In computing, a system call is the mechanism used by an application program to request service from the operating system. ...
See also
Synchronization (or Sync) is a problem in timekeeping which requires the coordination of events to operate a system in unison. ...
In computer science, the fetch-and-add CPU instruction is a special instruction that atomically tests and modifies the contents of a memory location. ...
In computer science, the compare-and-swap CPU instruction is a special instruction that atomically compares the contents of a memory location to a given value and, if they are the same, modifies the contents of that memory location to a given new value. ...
References - Hubertus Franke, Rusty Russell, Matthew Kirkwood, Fuss, futexes and furwocks: Fast Userlevel Locking in Linux, Ottawa Linux Symposium 2002.
- Futex manpages
- Ulrich Drepper, Futexes Are Tricky, Red Hat (v 1.4, 2008). (Explains futexes and how to use them.)
- Ingo Molnar, "Robust Futexes", Linux Kernel Documentation
- "Priority Inheritence Futexes", Linux Kernel Documentation
|