mirror of https://github.com/mkerrisk/man-pages
futex.2: tfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
This commit is contained in:
parent
d0442d147d
commit
c3f4c0196a
|
@ -59,7 +59,7 @@ A futex is a 32-bit value\(emreferred to below as a
|
|||
address is supplied to the
|
||||
.BR futex ()
|
||||
system call.
|
||||
(Futexes are 32-bits in size on all platforms, including 64-bit systems.)
|
||||
(Futexes are 32 bits in size on all platforms, including 64-bit systems.)
|
||||
All futex operations are governed by this value.
|
||||
In order to share a futex between processes,
|
||||
the futex is placed in a region of shared memory,
|
||||
|
@ -67,7 +67,7 @@ created using (for example)
|
|||
.BR mmap (2)
|
||||
or
|
||||
.BR shmat (2).
|
||||
(Thus the futex word may have different
|
||||
(Thus, the futex word may have different
|
||||
virtual addresses in different processes,
|
||||
but these addresses all refer to the same location in physical memory.)
|
||||
In a multithreaded program, it is sufficient to place the futex word
|
||||
|
@ -98,7 +98,7 @@ One use of futexes is for implementing locks.
|
|||
The state of the lock (i.e., acquired or not acquired)
|
||||
can be represented as an atomically accessed flag in shared memory.
|
||||
In the uncontended case,
|
||||
a thread can access or modify the lock state with atomic instructions
|
||||
a thread can access or modify the lock state with atomic instructions,
|
||||
for example atomically changing it from not acquired to acquired
|
||||
using an atomic compare-and-exchange instruction.
|
||||
(Such instructions are performed entirely in user mode,
|
||||
|
|
Loading…
Reference in New Issue