Futex

Futex

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.

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).

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.

See also

* Synchronization
* Fetch-and-add
* Compare and swap

References

* Hubertus Franke, Rusty Russell, Matthew Kirkwood, " [http://www.linux.org.uk/~ajh/ols2002_proceedings.pdf.gz Fuss, futexes and furwocks: Fast Userlevel Locking in Linux] ", Ottawa Linux Symposium 2002.
* [http://ds9a.nl/futex-manpages/ Futex manpages]
* Ulrich Drepper, " [http://people.redhat.com/drepper/futex.pdf Futexes Are Tricky] ", Red Hat (v 1.4, 2008). "(Explains futexes and how to use them.)"
* Ingo Molnar, " [http://lxr.linux.no/source/Documentation/robust-futexes.txt Robust Futexes] ", "Linux Kernel Documentation"
* " [http://lxr.linux.no/source/Documentation/pi-futex.txt Priority Inheritence Futexes] ", "Linux Kernel Documentation"


Wikimedia Foundation. 2010.

Игры ⚽ Поможем сделать НИР

Look at other dictionaries:

  • Futex — Ein Futex (engl. fast userspace mutual exclusion, etwa schneller gegenseitiger Ausschluss im Userspace) ist ein Mutex Lockingmechanismus, der vom Betriebssystem Linux unterstützt wird. Die Besonderheit der Futex Implementierung liegt darin, dass… …   Deutsch Wikipedia

  • Futex — Un Futex (anglais : Fast Userspace Mutex) est un mécanisme élémentaire et rapide de verrouillage en mode utilisateur, qui permet également de construire des éléments plus élaborés tels que les sémaphores ou les mutex POSIX sous Linux. Les… …   Wikipédia en Français

  • Spurious wakeup — In the POSIX thread API, the function pthread cond wait is used to wait on a condition variable. A naive programmer might expect that when a thread returns from this function, the condition associated with the condition variable will be true.… …   Wikipedia

  • Exclusion Mutuelle — Un Mutex (anglais : Mutual exclusion, Exclusion mutuelle) est une primitive de synchronisation utilisée en programmation informatique pour éviter que des ressources partagées d un système ne soient utilisées en même temps. Son implémentation …   Wikipédia en Français

  • Exclusion mutuelle — Un Mutex (anglais : Mutual exclusion, Exclusion mutuelle) est une primitive de synchronisation utilisée en programmation informatique pour éviter que des ressources partagées d un système ne soient utilisées en même temps. Son implémentation …   Wikipédia en Français

  • Parallélisme (informatique) — Pour les articles homonymes, voir parallèle. Blue Gene L cabinet., un des ordinateurs massivement parallèle les plus rapides des années 2000 En informatiqu …   Wikipédia en Français

  • MontaVista Linux — основанная на Linux операционная система ориентированная на встраиваемые системы. Система разрабатывается компанией MontaVista Software (en). Содержание 1 MontaVista Linux Professional Edition 5.0 2 MontaVista Linux 6 …   Википедия

  • Native POSIX Thread Library — The Native POSIX Thread Library (NPTL) is a software feature that enables the Linux kernel to run programs written to use POSIX Threads efficiently. Contents 1 History 2 Design 3 See also 4 References …   Wikipedia

  • Compare-and-swap — (CAS) (engl. für „Vergleichen und Tauschen“) Instruktionen werden in der Informatik verwendet, um Locking und Synchronisationsoperationen zu implementieren. Eine Speicherstelle wird mit einem vorgegebenen Wert verglichen, und bei Übereinstimmung… …   Deutsch Wikipedia

  • NPTL — Die Native POSIX Thread Library (NPTL) ist eine moderne Implementierung einer Threading Bibliothek für Linux. Sie wird in Verbindung mit der GNU C Library (glibc) verwendet und erlaubt Linux Programmen die Verwendung von POSIX Threads. Geschichte …   Deutsch Wikipedia

Share the article and excerpts

Direct link
Do a right-click on the link above
and select “Copy Link”