Print this page
11622 clean up rarer mandoc lint warnings

@@ -7,11 +7,10 @@
 .TH THREADS 5 "Mar 27, 2016"
 threads, pthreads \- POSIX pthreads, c11, and illumos threads concepts
 gcc -D_REENTRANT [ \fIflag\fR... ] \fIfile\fR... [ \fIlibrary\fR... ]

@@ -18,11 +17,10 @@
 #include <pthread.h>
 .SS "C11"
 gcc -std=c11 -D_REENTRANT [ \fIflag\fR... ] \fIfile\fR... [ \fIlibrary\fR... ]

@@ -29,11 +27,10 @@
 #include <threads.h>
 .SS "illumos"
 gcc -D_REENTRANT [ \fIflag\fR... ] \fIfile\fR... [ \fIlibrary\fR... ]

@@ -45,11 +42,10 @@
 #include <thread.h>
 A thread is an independent source of execution within a process. Every process
 is created with a single thread, which calls the
 .B main
 function. A process may have multiple threads, all of which are scheduled
 independently by the system and may run concurrently. Threads within a process

@@ -82,18 +78,16 @@
 guaranteed to be fully portable to other POSIX-compliant environments. C11
 threads are an optional part of ISO C11 and may not exist on every ISO C11
 platform. POSIX, C11, and illumos threads require different source and include
 files. See \fBSYNOPSIS\fR.
 .SS "Similarities"
 Most of the POSIX and illumos threading functions have counterparts with each
 other. POSIX function names, with the exception of the semaphore names, have a
 "\fBpthread\fR" prefix. Function names for similar POSIX and illumos functions
 have similar endings. Typically, similar POSIX and illumos functions have the
 same number and use of arguments.
 .SS "Differences"
 POSIX pthreads and illumos threads differ in the following ways:
 .RS +4
 .ie t \(bu
 .el o

@@ -136,11 +130,10 @@
 .el o
 illumos threads implement daemon threads, for whose demise the process does not
 .SS "Comparison to C11 Threads"
 C11 threads are not as functional as either POSIX or illumos threads. C11
 threads only support intra-process locking and do not have any form of
 readers/writer locking or semaphores. In general, POSIX threads will be more
 portable than C11 threads, all POSIX-compliant systems support pthreads;
 however, not all C environments support C11 Threads.

@@ -153,11 +146,10 @@
 equivalent to ENOMEM and EBUSY, are all squashed into one. As such, users of the
 platform are encouraged to use POSIX threads, unless a portability concern
 dictates otherwise.
 The following table compares the POSIX pthreads, C11 threads, and illumos
 threads functions.  When a comparable interface is not available either in POSIX
 pthreads, C11 threads  or illumos threads, a hyphen (\fB-\fR) appears in the
 .SS "Functions Related to Creation"

@@ -334,11 +326,11 @@
 l l l .
 \fBPOSIX\fR     \fBillumos\fR   \fBC11\fR
 \fBsem_init()\fR        \fBsema_init()\fR       \fB-\fR
 \fBsem_open()\fR        \fB-\fR \fB-\fR
 \fBsem_close()\fR       \fB-\fR \fB-\fR
-\fBsem_wait()\fR        \fBsema_wait()\ \fB-\fR
+\fBsem_wait()\fR        \fBsema_wait()\fR       \fB-\fR
 \fBsem_trywait()\fR     \fBsema_trywait()\fR    \fB-\fR
 \fBsem_post()\fR        \fBsema_post()\fR       \fB-\fR
 \fBsem_getvalue()\fR    \fB-\fR \fB-\fR
 \fBsem_unlink()\fR      \fB-\fR \fB-\fR
 \fBsem_destroy()\fR     \fBsema_destroy()\fR    \fB-\fR

@@ -371,11 +363,10 @@
 \fB-\fR \fBthr_stksegment()\fR  \fB-\fR
 .SS "Synchronization"
 Multithreaded behavior is asynchronous, and therefore,  optimized for
 concurrent and parallel processing. As threads, always from within the same
 process and  sometimes from multiple processes, share global data with each
 other, they are not guaranteed exclusive access to the shared data at any point
 in time. Securing mutually exclusive access to shared data requires

@@ -387,19 +378,17 @@
 Synchronizing multiple threads diminishes their concurrency. The coarser the
 grain of synchronization, that is, the larger the block of code that is locked,
 the lesser the concurrency.
 .SS "MT \fBfork()\fR"
 If a threads program calls \fBfork\fR(2), it implicitly calls \fBfork1\fR(2),
 which replicates only the calling thread. Should there be any outstanding
 mutexes throughout the process, the application should call
 \fBpthread_atfork\fR(3C) to wait for and acquire those mutexes prior to calling
 .SS "POSIX Threads"
 illumos supports the following three POSIX scheduling policies:
 .ne 2

@@ -466,30 +455,26 @@
 Threads are scheduled according to the Fixed-Priority Class (FX) policy as
 described in \fBpriocntl\fR(2).
 .SS "illumos Threads"
 Only scheduling policy supported is \fBSCHED_OTHER\fR, which is timesharing,
 based on the \fBTS\fR scheduling class.
 In a multithreaded application, \fBEINTR\fR can be returned from blocking
 system calls when another thread calls \fBforkall\fR(2).
 .SS "\fB-mt\fR compiler option"
 The \fB-mt\fR compiler option compiles and links for multithreaded code. It
 compiles source files with \(mi\fBD_REENTRANT\fR and augments the set of
 support libraries properly.
 Users of other compilers such as gcc and clang should manually set
 \(mi\fBD_REENTRANT\fR on the compilation line. There are no other libraries or
 flags necessary.
 See \fBattributes\fR(5) for descriptions of the following attributes:

@@ -500,11 +485,10 @@
 MT-Level        MT-Safe, Fork 1-Safe
 \fBcrle\fR(1), \fBfork\fR(2), \fBpriocntl\fR(2), \fBlibpthread\fR(3LIB),
 \fBlibrt\fR(3LIB), \fBlibthread\fR(3LIB), \fBpthread_atfork\fR(3C),
 \fBpthread_create\fR(3C), \fBattributes\fR(5), \fBstandards\fR(5)