Print this page
9842 man page typos and spelling
Split |
Close |
Expand all |
Collapse all |
--- old/usr/src/man/man5/threads.5
+++ new/usr/src/man/man5/threads.5
1 1 '\" te
2 2 .\" Copyright (c) 2008, Sun Microsystems, Inc. All Rights Reserved.
3 3 .\" Copyright 2016 Joyent, Inc.
4 4 .\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License"). You may not use this file except in compliance with the License.
5 5 .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing. See the License for the specific language governing permissions and limitations under the License.
6 6 .\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE. If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
7 7 .TH THREADS 5 "Mar 27, 2016"
8 8 .SH NAME
9 9 threads, pthreads \- POSIX pthreads, c11, and illumos threads concepts
10 10 .SH SYNOPSIS
11 11 .SS "POSIX"
12 12 .LP
13 13 .nf
14 14 gcc -D_REENTRANT [ \fIflag\fR... ] \fIfile\fR... [ \fIlibrary\fR... ]
15 15 .fi
16 16
17 17 .LP
18 18 .nf
19 19 #include <pthread.h>
20 20 .fi
21 21
22 22 .SS "C11"
23 23 .LP
24 24 .nf
25 25 gcc -std=c11 -D_REENTRANT [ \fIflag\fR... ] \fIfile\fR... [ \fIlibrary\fR... ]
26 26 .fi
27 27
28 28 .LP
29 29 .nf
30 30 #include <threads.h>
31 31 .fi
32 32
33 33 .SS "illumos"
34 34 .LP
35 35 .nf
36 36 gcc -D_REENTRANT [ \fIflag\fR... ] \fIfile\fR... [ \fIlibrary\fR... ]
37 37 .fi
38 38
39 39 .LP
40 40 .nf
41 41 #include <sched.h>
42 42 .fi
43 43
44 44 .LP
45 45 .nf
46 46 #include <thread.h>
47 47 .fi
48 48
49 49 .SH DESCRIPTION
50 50 .LP
51 51 A thread is an independent source of execution within a process. Every process
52 52 is created with a single thread, which calls the
53 53 .B main
54 54 function. A process may have multiple threads, all of which are scheduled
55 55 independently by the system and may run concurrently. Threads within a process
56 56 all use the same address space and as a result can access all data in the
57 57 process; however, each thread is created with its own attributes and its own
58 58 stack. When a thread is created, it inherits the signal mask of the thread which
59 59 created it, but it has no pending signals.
60 60 .sp
61 61 .LP
62 62 All threads of execution have their own, independent life time, though it is
63 63 ultimately bounded by the life time of the process. If the process terminates
64 64 for any reason, whether due to a call to \fBexit\fR(3C), the receipt of a fatal
65 65 signal, or some other reason, then all threads within the process are
66 66 terminated. Threads may themselves exit and status information of them may be
67 67 obtained, for more information, see the \fBpthread_detach\fR(3C),
68 68 \fBpthread_join\fR(3C), and \fBpthread_exit\fR(3C) functions, and their
69 69 equivalents as described in the tables later on in the manual.
70 70 .sp
71 71 .LP
72 72 Most hardware platforms do not have any special synchronization for data objects
73 73 which may be accessed concurrently from multiple threads of execution. To avoid
74 74 such problems, programs may use atomic operations (see \fBatomic_ops\fR(3C)) and
75 75 locking primitives, such as mutexes, readers/writer locks, condition variables,
76 76 and semaphores. Note, that depending on the hardware platform, memory
77 77 synchronization may be necessary, for more information, see \fBmembar_ops\fR(3C).
78 78 .LP
79 79 POSIX, C11, and illumos threads each have their own implementation within
80 80 \fBlibc\fR(3LIB). All implementations are interoperable, their functionality
81 81 similar, and can be used within the same application. Only POSIX threads are
82 82 guaranteed to be fully portable to other POSIX-compliant environments. C11
83 83 threads are an optional part of ISO C11 and may not exist on every ISO C11
84 84 platform. POSIX, C11, and illumos threads require different source and include
85 85 files. See \fBSYNOPSIS\fR.
86 86 .SS "Similarities"
87 87 .LP
88 88 Most of the POSIX and illumos threading functions have counterparts with each
89 89 other. POSIX function names, with the exception of the semaphore names, have a
90 90 "\fBpthread\fR" prefix. Function names for similar POSIX and illumos functions
91 91 have similar endings. Typically, similar POSIX and illumos functions have the
92 92 same number and use of arguments.
93 93 .SS "Differences"
94 94 .LP
95 95 POSIX pthreads and illumos threads differ in the following ways:
96 96 .RS +4
97 97 .TP
98 98 .ie t \(bu
99 99 .el o
100 100 POSIX threads are more portable.
101 101 .RE
102 102 .RS +4
103 103 .TP
104 104 .ie t \(bu
105 105 .el o
106 106 POSIX threads establish characteristics for each thread according to
107 107 configurable attribute objects.
108 108 .RE
109 109 .RS +4
110 110 .TP
111 111 .ie t \(bu
112 112 .el o
113 113 POSIX pthreads implement thread cancellation.
114 114 .RE
115 115 .RS +4
116 116 .TP
117 117 .ie t \(bu
118 118 .el o
119 119 POSIX pthreads enforce scheduling algorithms.
120 120 .RE
121 121 .RS +4
122 122 .TP
123 123 .ie t \(bu
124 124 .el o
125 125 POSIX pthreads allow for clean-up handlers for \fBfork\fR(2) calls.
126 126 .RE
127 127 .RS +4
128 128 .TP
129 129 .ie t \(bu
130 130 .el o
131 131 illumos threads can be suspended and continued.
132 132 .RE
133 133 .RS +4
134 134 .TP
135 135 .ie t \(bu
136 136 .el o
137 137 illumos threads implement daemon threads, for whose demise the process does not
138 138 wait.
139 139 .RE
140 140 .SS "Comparison to C11 Threads"
141 141 .LP
142 142 C11 threads are not as functional as either POSIX or illumos threads. C11
143 143 threads only support intra-process locking and do not have any form of
144 144 readers/writer locking or semaphores. In general, POSIX threads will be more
145 145 portable than C11 threads, all POSIX-compliant systems support pthreads;
146 146 however, not all C environments support C11 Threads.
147 147 .sp
148 148 .LP
149 149 In addition to lacking other common synchronization primitives, the ISO/IEC
150 150 standard for C11 threads does not have rich error semantics. In an effort to not
151 151 extend the set of error numbers standardized in ISO/IEC C11, none of the
152 152 routines set errno and instead multiple distinguishable errors, aside from the
153 153 equivalent to ENOMEM and EBUSY, are all squashed into one. As such, users of the
154 154 platform are encouraged to use POSIX threads, unless a portability concern
155 155 dictates otherwise.
156 156
157 157 .SH FUNCTION COMPARISON
158 158 .LP
159 159 The following table compares the POSIX pthreads, C11 threads, and illumos
160 160 threads functions. When a comparable interface is not available either in POSIX
161 161 pthreads, C11 threads or illumos threads, a hyphen (\fB-\fR) appears in the
162 162 column.
163 163 .SS "Functions Related to Creation"
164 164
165 165 .TS
166 166 l l l
167 167 l l l .
168 168 \fBPOSIX\fR \fBillumos\fR \fBC11\fR
169 169 \fBpthread_create()\fR \fBthr_create()\fR \fBthrd_create()\fR
170 170 \fBpthread_attr_init()\fR \fB-\fR \fB-\fR
171 171 \fBpthread_attr_setdetachstate()\fR \fB-\fR \fB-\fR
172 172 \fBpthread_attr_getdetachstate()\fR \fB-\fR \fB-\fR
173 173 \fBpthread_attr_setinheritsched()\fR \fB-\fR \fB-\fR
174 174 \fBpthread_attr_getinheritsched()\fR \fB-\fR \fB-\fR
175 175 \fBpthread_attr_setschedparam()\fR \fB-\fR \fB-\fR
176 176 \fBpthread_attr_getschedparam()\fR \fB-\fR \fB-\fR
177 177 \fBpthread_attr_setschedpolicy()\fR \fB-\fR \fB-\fR
178 178 \fBpthread_attr_getschedpolicy()\fR \fB-\fR \fB-\fR
179 179 \fBpthread_attr_setscope()\fR \fB-\fR \fB-\fR
180 180 \fBpthread_attr_getscope()\fR \fB-\fR \fB-\fR
181 181 \fBpthread_attr_setstackaddr()\fR \fB-\fR \fB-\fR
182 182 \fBpthread_attr_getstackaddr()\fR \fB-\fR \fB-\fR
183 183 \fBpthread_attr_setstacksize()\fR \fB-\fR \fB-\fR
184 184 \fBpthread_attr_getstacksize()\fR \fB-\fR \fB-\fR
185 185 \fBpthread_attr_getguardsize()\fR \fB-\fR \fB-\fR
186 186 \fBpthread_attr_setguardsize()\fR \fB-\fR \fB-\fR
187 187 \fBpthread_attr_destroy()\fR \fB-\fR \fB-\fR
188 188 \fB-\fR \fBthr_min_stack()\fR \fB-\fR
189 189 .TE
190 190
191 191 .SS "Functions Related to Exit"
192 192
193 193 .TS
194 194 l l l
195 195 l l l .
196 196 \fBPOSIX\fR \fBillumos\fR \fBC11\fR
197 197 \fBpthread_exit()\fR \fBthr_exit()\fR \fBthrd_exit()\fR
198 198 \fBpthread_join()\fR \fBthr_join()\fR \fBthrd_join()\fR
199 199 \fBpthread_detach()\fR \fB-\fR \fBthrd_detach()\fR
200 200 .TE
201 201
202 202 .SS "Functions Related to Thread Specific Data"
203 203
204 204 .TS
205 205 l l l
206 206 l l l .
207 207 \fBPOSIX\fR \fBillumos\fR \fBC11\fR
208 208 \fBpthread_key_create()\fR \fBthr_keycreate()\fR \fBtss_create()\fR
209 209 \fBpthread_setspecific()\fR \fBthr_setspecific()\fR \fBtss_set()\fR
210 210 \fBpthread_getspecific()\fR \fBthr_getspecific()\fR \fBtss_get()\fR
211 211 \fBpthread_key_delete()\fR \fB-\fR \fBtss_delete()\fR
212 212 .TE
213 213
214 214 .SS "Functions Related to Signals"
215 215
216 216 .TS
217 217 l l l
218 218 l l l .
219 219 \fBPOSIX\fR \fBillumos\fR \fBC11\fR
220 220 \fBpthread_sigmask()\fR \fBthr_sigsetmask()\fR \fB-\fR
221 221 \fBpthread_kill()\fR \fBthr_kill()\fR \fB-\fR
222 222 .TE
223 223
224 224 .SS "Functions Related to IDs"
225 225
226 226 .TS
227 227 l l l
228 228 l l l .
229 229 \fBPOSIX\fR \fBillumos\fR \fBc11\fR
230 230 \fBpthread_self()\fR \fBthr_self()\fR \fBthrd_current()\fR
231 231 \fBpthread_equal()\fR \fB-\fR \fBthrd_equal()\fR
232 232 \fB-\fR \fBthr_main()\fR \fB-\fR
233 233 .TE
234 234
235 235 .SS "Functions Related to Scheduling"
236 236
237 237 .TS
238 238 l l l
239 239 l l l .
240 240 \fBPOSIX\fR \fBillumos\fR \fBC11\fR
241 241 \fB-\fR \fBthr_yield()\fR \fBthrd_yield()\fR
242 242 \fB-\fR \fBthr_suspend()\fR \fB-\fR
243 243 \fB-\fR \fBthr_continue()\fR \fB-\fR
244 244 \fBpthread_setconcurrency()\fR \fBthr_setconcurrency()\fR \fB-\fR
245 245 \fBpthread_getconcurrency()\fR \fBthr_getconcurrency()\fR \fB-\fR
246 246 \fBpthread_setschedparam()\fR \fBthr_setprio()\fR \fB-\fR
247 247 \fBpthread_setschedprio()\fR \fBthr_setprio()\fR \fB-\fR
248 248 \fBpthread_getschedparam()\fR \fBthr_getprio()\fR \fB-\fR
249 249 .TE
250 250
251 251 .SS "Functions Related to Cancellation"
252 252
253 253 .TS
254 254 l l l
255 255 l l l .
256 256 \fBPOSIX\fR \fBillumos\fR \fBC11\fR
257 257 \fBpthread_cancel()\fR \fB-\fR \fB-\fR
258 258 \fBpthread_setcancelstate()\fR \fB-\fR \fB-\fR
259 259 \fBpthread_setcanceltype()\fR \fB-\fR \fB-\fR
260 260 \fBpthread_testcancel()\fR \fB-\fR \fB-\fR
261 261 \fBpthread_cleanup_pop()\fR \fB-\fR \fB-\fR
262 262 \fBpthread_cleanup_push()\fR \fB-\fR \fB-\fR
263 263 .TE
264 264
265 265 .SS "Functions Related to Mutexes"
266 266
267 267 .TS
268 268 l l l
269 269 l l l .
270 270 \fBPOSIX\fR \fBillumos\fR \fBc11\fR
271 271 \fBpthread_mutex_init()\fR \fBmutex_init()\fR \fBmtx_init()\fR
272 272 \fBpthread_mutexattr_init()\fR \fB-\fR \fB-\fR
273 273 \fBpthread_mutexattr_setpshared()\fR \fB-\fR \fB-\fR
274 274 \fBpthread_mutexattr_getpshared()\fR \fB-\fR \fB-\fR
275 275 \fBpthread_mutexattr_setprotocol()\fR \fB-\fR \fB-\fR
276 276 \fBpthread_mutexattr_getprotocol()\fR \fB-\fR \fB-\fR
277 277 \fBpthread_mutexattr_setprioceiling()\fR \fB-\fR \fB-\fR
278 278 \fBpthread_mutexattr_getprioceiling()\fR \fB-\fR \fB-\fR
↓ open down ↓ |
278 lines elided |
↑ open up ↑ |
279 279 \fBpthread_mutexattr_settype()\fR \fB-\fR \fB-\fR
280 280 \fBpthread_mutexattr_gettype()\fR \fB-\fR \fB-\fR
281 281 \fBpthread_mutexattr_setrobust()\fR \fB-\fR \fB-\fR
282 282 \fBpthread_mutexattr_getrobust()\fR \fB-\fR \fB-\fR
283 283 \fBpthread_mutexattr_destroy()\fR \fB-\fR \fBmtx_destroy()\fR
284 284 \fBpthread_mutex_setprioceiling()\fR \fB-\fR \fB-\fR
285 285 \fBpthread_mutex_getprioceiling()\fR \fB-\fR \fB-\fR
286 286 \fBpthread_mutex_lock()\fR \fBmutex_lock()\fR \fBmtx_lock()\fR
287 287 \fBpthread_mutex_timedlock()\fR \fB-\fR \fBmtx_timedlock()\fR
288 288 \fBpthread_mutex_trylock()\fR \fBmutex_trylock()\fR \fBmtx_trylock()\fR
289 -\fBpthread_mutex_unlock()\fR \fBmutex_unlock()\fR \fBmtx_unlcok()\fR
289 +\fBpthread_mutex_unlock()\fR \fBmutex_unlock()\fR \fBmtx_unlock()\fR
290 290 \fBpthread_mutex_destroy()\fR \fBmutex_destroy()\fR \fBmtx_destroy()\fR
291 291 .TE
292 292
293 293 .SS "Functions Related to Condition Variables"
294 294
295 295 .TS
296 296 l l l
297 297 l l l .
298 298 \fBPOSIX\fR \fBillumos\fR \fBC11\fR
299 299 \fBpthread_cond_init()\fR \fBcond_init()\fR \fBcnd_init()\fR
300 300 \fBpthread_condattr_init()\fR \fB-\fR \fB-\fR
301 301 \fBpthread_condattr_setpshared()\fR \fB-\fR \fB-\fR
302 302 \fBpthread_condattr_getpshared()\fR \fB-\fR \fB-\fR
303 303 \fBpthread_condattr_destroy()\fR \fB-\fR \fB-\fR
304 304 \fBpthread_cond_wait()\fR \fBcond_wait()\fR \fBcnd_wait()\fR
305 305 \fBpthread_cond_timedwait()\fR \fBcond_timedwait()\fR \fBcond_timedwait()\fR
306 306 \fBpthread_cond_signal()\fR \fBcond_signal()\fR \fBcnd_signal()\fR
307 307 \fBpthread_cond_broadcast()\fR \fBcond_broadcast()\fR \fBcnd_broadcast()\fR
308 308 \fBpthread_cond_destroy()\fR \fBcond_destroy()\fR \fBcnd_destroy()\fR
309 309 .TE
310 310
311 311 .SS "Functions Related to Reader/Writer Locking"
312 312
313 313 .TS
314 314 l l l
315 315 l l l .
316 316 \fBPOSIX\fR \fBillumos\fR \fBC11\fR
317 317 \fBpthread_rwlock_init()\fR \fBrwlock_init()\fR \fB-\fR
318 318 \fBpthread_rwlock_rdlock()\fR \fBrw_rdlock()\fR \fB-\fR
319 319 \fBpthread_rwlock_tryrdlock()\fR \fBrw_tryrdlock()\fR \fB-\fR
320 320 \fBpthread_rwlock_wrlock()\fR \fBrw_wrlock()\fR \fB-\fR
321 321 \fBpthread_rwlock_trywrlock()\fR \fBrw_trywrlock()\fR \fB-\fR
322 322 \fBpthread_rwlock_unlock()\fR \fBrw_unlock()\fR \fB-\fR
323 323 \fBpthread_rwlock_destroy()\fR \fBrwlock_destroy()\fR \fB-\fR
324 324 \fBpthread_rwlockattr_init()\fR \fB-\fR \fB-\fR
325 325 \fBpthread_rwlockattr_destroy()\fR \fB-\fR \fB-\fR
326 326 \fBpthread_rwlockattr_getpshared()\fR \fB-\fR \fB-\fR
327 327 \fBpthread_rwlockattr_setpshared()\fR \fB-\fR \fB-\fR
328 328 .TE
329 329
330 330 .SS "Functions Related to Semaphores"
331 331
332 332 .TS
333 333 l l l
334 334 l l l .
335 335 \fBPOSIX\fR \fBillumos\fR \fBC11\fR
336 336 \fBsem_init()\fR \fBsema_init()\fR \fB-\fR
337 337 \fBsem_open()\fR \fB-\fR \fB-\fR
338 338 \fBsem_close()\fR \fB-\fR \fB-\fR
339 339 \fBsem_wait()\fR \fBsema_wait()\ \fB-\fR
340 340 \fBsem_trywait()\fR \fBsema_trywait()\fR \fB-\fR
341 341 \fBsem_post()\fR \fBsema_post()\fR \fB-\fR
342 342 \fBsem_getvalue()\fR \fB-\fR \fB-\fR
343 343 \fBsem_unlink()\fR \fB-\fR \fB-\fR
344 344 \fBsem_destroy()\fR \fBsema_destroy()\fR \fB-\fR
345 345 .TE
346 346
347 347 .SS "Functions Related to fork(\|) Clean Up"
348 348
349 349 .TS
350 350 l l l
351 351 l l l .
352 352 \fBPOSIX\fR \fBillumos\fR \fBC11\fR
353 353 \fBpthread_atfork()\fR \fB-\fR \fB-\fR
354 354 .TE
355 355
356 356 .SS "Functions Related to Limits"
357 357
358 358 .TS
359 359 l l l
360 360 l l l .
361 361 \fBPOSIX\fR \fBillumos\fR \fBC11\fR
362 362 \fBpthread_once()\fR \fB-\fR \fBcall_once()\fR
363 363 .TE
364 364
365 365 .SS "Functions Related to Debugging"
366 366
367 367 .TS
368 368 l l l
369 369 l l l .
370 370 \fBPOSIX\fR \fBillumos\fR \fBC11\fR
371 371 \fB-\fR \fBthr_stksegment()\fR \fB-\fR
372 372 .TE
373 373
374 374 .SH LOCKING
375 375 .SS "Synchronization"
376 376 .LP
377 377 Multithreaded behavior is asynchronous, and therefore, optimized for
378 378 concurrent and parallel processing. As threads, always from within the same
379 379 process and sometimes from multiple processes, share global data with each
380 380 other, they are not guaranteed exclusive access to the shared data at any point
381 381 in time. Securing mutually exclusive access to shared data requires
382 382 synchronization among the threads. Both POSIX and illumos implement four
383 383 synchronization mechanisms: mutexes, condition variables, reader/writer locking
384 384 (\fIoptimized frequent-read occasional-write mutex\fR), and semaphores, where as
385 385 C11 threads only implement two mechanisms: mutexes and condition variables.
386 386 .sp
387 387 .LP
388 388 Synchronizing multiple threads diminishes their concurrency. The coarser the
389 389 grain of synchronization, that is, the larger the block of code that is locked,
390 390 the lesser the concurrency.
391 391 .SS "MT \fBfork()\fR"
392 392 .LP
393 393 If a threads program calls \fBfork\fR(2), it implicitly calls \fBfork1\fR(2),
394 394 which replicates only the calling thread. Should there be any outstanding
395 395 mutexes throughout the process, the application should call
396 396 \fBpthread_atfork\fR(3C) to wait for and acquire those mutexes prior to calling
397 397 \fBfork()\fR.
398 398 .SH SCHEDULING
399 399 .SS "POSIX Threads"
400 400 .LP
401 401 illumos supports the following three POSIX scheduling policies:
402 402 .sp
403 403 .ne 2
404 404 .na
405 405 \fB\fBSCHED_OTHER\fR\fR
406 406 .ad
407 407 .RS 15n
408 408 Traditional Timesharing scheduling policy. It is based on the timesharing (TS)
409 409 scheduling class.
410 410 .RE
411 411
412 412 .sp
413 413 .ne 2
414 414 .na
415 415 \fB\fBSCHED_FIFO\fR\fR
416 416 .ad
417 417 .RS 15n
418 418 First-In-First-Out scheduling policy. Threads scheduled to this policy, if not
419 419 preempted by a higher priority, will proceed until completion. Such threads are
420 420 in real-time (RT) scheduling class. The calling process must have a effective
421 421 user \fBID\fR of \fB0\fR.
422 422 .RE
423 423
424 424 .sp
425 425 .ne 2
426 426 .na
427 427 \fB\fBSCHED_RR\fR\fR
428 428 .ad
429 429 .RS 15n
430 430 Round-Robin scheduling policy. Threads scheduled to this policy, if not
431 431 preempted by a higher priority, will execute for a time period determined by
432 432 the system. Such threads are in real-time (RT) scheduling class and the calling
433 433 process must have a effective user \fBID\fR of \fB0\fR.
434 434 .RE
435 435
436 436 .sp
437 437 .LP
438 438 In addition to the POSIX-specified scheduling policies above, illumos also
439 439 supports these scheduling policies:
440 440 .sp
441 441 .ne 2
442 442 .na
443 443 \fB\fBSCHED_IA\fR\fR
444 444 .ad
445 445 .RS 13n
446 446 Threads are scheduled according to the Inter-Active Class (IA) policy as
447 447 described in \fBpriocntl\fR(2).
448 448 .RE
449 449
450 450 .sp
451 451 .ne 2
452 452 .na
453 453 \fB\fBSCHED_FSS\fR\fR
454 454 .ad
455 455 .RS 13n
456 456 Threads are scheduled according to the Fair-Share Class (FSS) policy as
457 457 described in \fBpriocntl\fR(2).
458 458 .RE
459 459
460 460 .sp
461 461 .ne 2
462 462 .na
463 463 \fB\fBSCHED_FX\fR\fR
464 464 .ad
465 465 .RS 13n
466 466 Threads are scheduled according to the Fixed-Priority Class (FX) policy as
467 467 described in \fBpriocntl\fR(2).
468 468 .RE
469 469
470 470 .SS "illumos Threads"
471 471 .LP
472 472 Only scheduling policy supported is \fBSCHED_OTHER\fR, which is timesharing,
473 473 based on the \fBTS\fR scheduling class.
474 474 .SH ERRORS
475 475 .LP
476 476 In a multithreaded application, \fBEINTR\fR can be returned from blocking
477 477 system calls when another thread calls \fBforkall\fR(2).
478 478 .SH USAGE
479 479 .SS "\fB-mt\fR compiler option"
480 480 .LP
481 481 The \fB-mt\fR compiler option compiles and links for multithreaded code. It
482 482 compiles source files with \(mi\fBD_REENTRANT\fR and augments the set of
483 483 support libraries properly.
484 484 .sp
485 485 .LP
486 486 Users of other compilers such as gcc and clang should manually set
487 487 \(mi\fBD_REENTRANT\fR on the compilation line. There are no other libraries or
488 488 flags necessary.
489 489 .SH ATTRIBUTES
490 490 .LP
491 491 See \fBattributes\fR(5) for descriptions of the following attributes:
492 492 .sp
493 493
494 494 .sp
495 495 .TS
496 496 box;
497 497 c | c
498 498 l | l .
499 499 ATTRIBUTE TYPE ATTRIBUTE VALUE
500 500 _
501 501 MT-Level MT-Safe, Fork 1-Safe
502 502 .TE
503 503
504 504 .SH SEE ALSO
505 505 .LP
506 506 \fBcrle\fR(1), \fBfork\fR(2), \fBpriocntl\fR(2), \fBlibpthread\fR(3LIB),
507 507 \fBlibrt\fR(3LIB), \fBlibthread\fR(3LIB), \fBpthread_atfork\fR(3C),
508 508 \fBpthread_create\fR(3C), \fBattributes\fR(5), \fBstandards\fR(5)
509 509 .sp
510 510 .LP
511 511 \fILinker and Libraries Guide\fR
↓ open down ↓ |
212 lines elided |
↑ open up ↑ |
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX