1.\" $NetBSD: pthread.3,v 1.4 2005/02/01 11:38:27 daniel Exp $ 2.\" 3.\" Copyright (c) 2003 Hubert Feyrer <hubertf@NetBSD.org> 4.\" and Thomas Klausner <wiz@NetBSD.org> 5.\" All rights reserved. 6.\" 7.\" Redistribution and use in source and binary forms, with or without 8.\" modification, are permitted provided that the following conditions 9.\" are met: 10.\" 1. Redistributions of source code must retain the above copyright 11.\" notice, this list of conditions and the following disclaimer. 12.\" 2. Redistributions in binary form must reproduce the above copyright 13.\" notice, this list of conditions and the following disclaimer in the 14.\" documentation and/or other materials provided with the distribution. 15.\" 3. The name of the authors may not be used to endorse or promote products 16.\" derived from this software without specific prior written permission. 17.\" 18.\" THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS OR 19.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 20.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 21.\" IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY DIRECT, INDIRECT, 22.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 23.\" BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 24.\" LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED 25.\" AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 26.\" OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 27.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 28.\" SUCH DAMAGE. 29.\" 30.Dd February 1, 2005 31.Dt PTHREAD 3 32.Os 33.Sh NAME 34.Nm pthread 35.Nd POSIX Threads Library 36.Sh LIBRARY 37.Lb libpthread 38.Sh SYNOPSIS 39.In pthread.h 40.Pp 41.Nm cc 42.Op Ar flags 43.Ar files 44.Fl lpthread 45.Op Ar libraries 46.Sh DESCRIPTION 47The 48.Nm 49library is an implementation of the standard 50.Tn POSIX 51threads library using the Scheduler Activations framework 52in the 53.Nx 54kernel, providing a kernel-supported MxN scheduling system. 55.Sh ENVIRONMENT 56.Bl -tag -width PTHREAD_DEBUGCOUNTERSXX -compact 57.It Ev PTHREAD_CONCURRENCY 58The number of concurrent threads to be run. 59This value should at least be 1, 60and smaller than or equal to the number of CPUs. 61.It Ev PTHREAD_DIAGASSERT 62Possible values are any combinations of: 63.Bl -tag -width ignoreXX -offset indent -compact 64.It Sy A 65Ignore errors. 66.It Sy a 67Abort on errors, creating a core dump for further debugging. 68.It Sy E 69Do not log errors to stdout. 70.It Sy e 71Log errors to stdout. 72.It Sy L 73Do not log errors via 74.Xr syslogd 8 . 75.It Sy l 76Log errors via 77.Xr syslogd 8 . 78.El 79.It Ev PTHREAD_DEBUGCOUNTERS 80Print pthread event counters before the program terminates. 81.It Ev PTHREAD_DEBUGLOG 82Write debugging information into shared memory. 83This debug log can be parsed and printed by the 84.Nm debuglog 85program found in 86.Pa src/lib/libpthread/debuglog.c . 87.\" Following commented out since it will be removed shortly. 88.\".It Ev PTHREAD_PREEMPT 89.\"Generate upcalls on a vanilla 90.\".Fn preempt . 91.It Ev PTHREAD_RRTIME 92Integer value giving the round-robin interval in ms. 93The default is 100. 94If set to 0, timer-based round-robin scheduling is disabled. 95.It Ev PTHREAD_STACKSIZE 96Integer value giving the stack size in kilobytes. 97This allows to set a smaller stack size than the default stack size. 98The default stack size is the current limit on the stack size as 99set with the shell's command to change limits 100.Ic ( limit 101for 102.Xr csh 1 , 103or 104.Ic ulimit 105for 106.Xr sh 1 ) . 107.El 108.Sh SEE ALSO 109.Xr pthread_attr 3 , 110.Xr pthread_barrier_destroy 3 , 111.Xr pthread_barrier_init 3 , 112.Xr pthread_barrier_wait 3 , 113.Xr pthread_barrierattr 3 , 114.Xr pthread_cancel 3 , 115.Xr pthread_cleanup_push 3 , 116.Xr pthread_cond_broadcast 3 , 117.Xr pthread_cond_destroy 3 , 118.Xr pthread_cond_init 3 , 119.Xr pthread_cond_wait 3 , 120.Xr pthread_condattr 3 , 121.Xr pthread_create 3 , 122.Xr pthread_detach 3 , 123.Xr pthread_equal 3 , 124.Xr pthread_exit 3 , 125.Xr pthread_getspecific 3 , 126.Xr pthread_join 3 , 127.Xr pthread_key_create 3 , 128.Xr pthread_key_delete 3 , 129.Xr pthread_kill 3 , 130.Xr pthread_mutex_destroy 3 , 131.Xr pthread_mutex_init 3 , 132.Xr pthread_mutex_lock 3 , 133.Xr pthread_mutex_unlock 3 , 134.Xr pthread_mutexattr 3 , 135.Xr pthread_once 3 , 136.Xr pthread_rwlock_destroy 3 , 137.Xr pthread_rwlock_init 3 , 138.Xr pthread_rwlock_rdlock 3 , 139.Xr pthread_rwlock_unlock 3 , 140.Xr pthread_rwlock_wrlock 3 , 141.Xr pthread_rwlockattr 3 , 142.Xr pthread_schedparam 3 , 143.Xr pthread_self 3 , 144.Xr pthread_setspecific 3 , 145.Xr pthread_sigmask 3 , 146.Xr pthread_spin_destroy 3 , 147.Xr pthread_spin_init 3 , 148.Xr pthread_spin_lock 3 , 149.Xr pthread_spin_unlock 3 , 150.Xr pthread_testcancel 3 151.Rs 152.%A Thomas E. Anderson 153.%A Brian N. Bershad 154.%A Edward D. Lazowska 155.%A Henry M. Levy 156.%T "Scheduler Activations: Effective Kernel Support for the \ 157User-Level Management of Parallelism" 158.%J ACM Transactions on Computer Systems 159.%V Vol. 10 160.%N No. 1 161.%D February 1992 162.%P 53-79 163.Re 164.Rs 165.%A Nathan J. Williams 166.%T "An Implementation of Scheduler Activations on the NetBSD \ 167Operating System" 168.%J "Proceedings of the FREENIX Track: 2002 USENIX Annual Technical \ 169Conference (FREENIX '02)" 170.%D 2002 171.%O http://www.mit.edu/people/nathanw/usenix/ 172.Re 173.Sh STANDARDS 174The 175.Nm 176library conforms to 177.St -p1003.1-2001 . 178.Sh AUTHORS 179.An Nathan J. Williams 180.Aq nathanw@NetBSD.org 181