aboutsummaryrefslogtreecommitdiffstats
path: root/man7/pthreads.7
diff options
context:
space:
mode:
Diffstat (limited to 'man7/pthreads.7')
-rw-r--r--man7/pthreads.726
1 files changed, 13 insertions, 13 deletions
diff --git a/man7/pthreads.7 b/man7/pthreads.7
index 011a029f85..ec0fa79efa 100644
--- a/man7/pthreads.7
+++ b/man7/pthreads.7
@@ -33,7 +33,7 @@ A single process can contain multiple threads,
all of which are executing the same program.
These threads share the same global memory (data and heap segments),
but each thread has its own stack (automatic variables).
-
+.PP
POSIX.1 also requires that threads share a range of other attributes
(i.e., these attributes are process-wide rather than per-thread):
.IP \- 3
@@ -121,12 +121,12 @@ This identifier is returned to the caller of
.BR pthread_create (3),
and a thread can obtain its own thread identifier using
.BR pthread_self (3).
-
+.PP
Thread IDs are guaranteed to be unique only within a process.
(In all pthreads functions that accept a thread ID as an argument,
that ID by definition refers to a thread in
the same process as the caller.)
-
+.PP
The system may reuse a thread ID after a terminated thread has been joined,
or a detached thread has terminated.
POSIX says: "If an application attempts to use a thread ID whose
@@ -135,7 +135,7 @@ lifetime has ended, the behavior is undefined."
A thread-safe function is one that can be safely
(i.e., it will deliver the same results regardless of whether it is)
called from multiple threads at the same time.
-
+.PP
POSIX.1-2001 and POSIX.1-2008 require that all functions specified
in the standard shall be thread-safe,
except for the following functions:
@@ -239,7 +239,7 @@ wctomb()
An async-cancel-safe function is one that can be safely called
in an application where asynchronous cancelability is enabled (see
.BR pthread_setcancelstate (3)).
-
+.PP
Only the following functions are required to be async-cancel-safe by
POSIX.1-2001 and POSIX.1-2008:
.in +4n
@@ -257,10 +257,10 @@ If a thread is cancelable, its cancelability type is deferred,
and a cancellation request is pending for the thread,
then the thread is canceled when it calls a function
that is a cancellation point.
-
+.PP
The following functions are required to be cancellation points by
POSIX.1-2001 and/or POSIX.1-2008:
-
+.PP
.\" FIXME
.\" Document the list of all functions that are cancellation points in glibc
.in +4n
@@ -325,10 +325,10 @@ write()
writev()
.fi
.in
-
+.PP
The following functions may be cancellation points according to
POSIX.1-2001 and/or POSIX.1-2008:
-
+.PP
.in +4n
.nf
access()
@@ -558,7 +558,7 @@ wprintf()
wscanf()
.fi
.in
-
+.PP
An implementation may also mark other functions
not specified in the standard as cancellation points.
In particular, an implementation is likely to mark
@@ -792,13 +792,13 @@ With NPTL, all of the threads in a process are placed
in the same thread group;
all members of a thread group share the same PID.
NPTL does not employ a manager thread.
-
+.PP
NPTL makes internal use of the first two real-time signals;
these signals cannot be used in applications.
See
.BR nptl (7)
for further details.
-
+.PP
NPTL still has at least one nonconformance with POSIX.1:
.IP \- 3
Threads do not share a common nice value.
@@ -909,7 +909,7 @@ bash$ $( LD_ASSUME_KERNEL=2.2.5 ldd /bin/ls | grep libc.so | \\
.BR nptl (7),
.BR sigevent (7),
.BR signal (7)
-
+.PP
Various Pthreads manual pages, for example:
.BR pthread_attr_init (3),
.BR pthread_atfork (3),