Futex Futex

Futex - Definition

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

Basically, 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

  • Rusty Russell, fuss, futexes and furwocks: Fast Userlevel Locking in Linux, Ottawa Linux Symposium 2002, online (http://www.linux.org.uk/~ajh/ols2002_proceedings.pdf.gz)

External links

Example Usage of Futex

kosaki55tea: しばらく悩み続けていたFutexのバグフィックスパッチを投稿した。これで悪は滅びた!(はず
kosaki55tea: Futexの無限ループバグがとれない。正確に言うと取れるけど人様が行った性能改善を台無しにしてしまう。誰だこんなバグを仕込んだPeterは。カーネル内に関数が成功を返すまで無限ループで再リトライとか入れるな :-/
chiu0329: asks why i can't let you go?!! Futex!! http://plurk.com/p/31hyxt
Copyright 2009 WordIQ.com - Privacy Policy  :: Terms of Use  :: Contact Us  :: About Us
This article is licensed under the GNU Free Documentation License. It uses material from the this Wikipedia article.