Blame


1 cfa37a7b 2004-04-10 devnull .TH THREAD 3
2 b2cfc4e2 2003-09-30 devnull .SH NAME
3 b2cfc4e2 2003-09-30 devnull alt,
4 b2cfc4e2 2003-09-30 devnull chancreate,
5 b2cfc4e2 2003-09-30 devnull chanfree,
6 b2cfc4e2 2003-09-30 devnull chanprint,
7 058b0118 2005-01-03 devnull chansetname,
8 b2cfc4e2 2003-09-30 devnull mainstacksize,
9 b2cfc4e2 2003-09-30 devnull proccreate,
10 b2cfc4e2 2003-09-30 devnull procdata,
11 b2cfc4e2 2003-09-30 devnull recv,
12 b2cfc4e2 2003-09-30 devnull recvp,
13 b2cfc4e2 2003-09-30 devnull recvul,
14 b2cfc4e2 2003-09-30 devnull send,
15 b2cfc4e2 2003-09-30 devnull sendp,
16 b2cfc4e2 2003-09-30 devnull sendul,
17 b2cfc4e2 2003-09-30 devnull nbrecv,
18 b2cfc4e2 2003-09-30 devnull nbrecvp,
19 b2cfc4e2 2003-09-30 devnull nbrecvul,
20 b2cfc4e2 2003-09-30 devnull nbsend,
21 b2cfc4e2 2003-09-30 devnull nbsendp,
22 b2cfc4e2 2003-09-30 devnull nbsendul,
23 b2cfc4e2 2003-09-30 devnull threadcreate,
24 b2cfc4e2 2003-09-30 devnull threaddata,
25 058b0118 2005-01-03 devnull threadexec,
26 058b0118 2005-01-03 devnull threadexecl,
27 b2cfc4e2 2003-09-30 devnull threadexits,
28 b2cfc4e2 2003-09-30 devnull threadexitsall,
29 b2cfc4e2 2003-09-30 devnull threadgetgrp,
30 b2cfc4e2 2003-09-30 devnull threadgetname,
31 b2cfc4e2 2003-09-30 devnull threadint,
32 b2cfc4e2 2003-09-30 devnull threadintgrp,
33 b2cfc4e2 2003-09-30 devnull threadkill,
34 b2cfc4e2 2003-09-30 devnull threadkillgrp,
35 b2cfc4e2 2003-09-30 devnull threadmain,
36 b2cfc4e2 2003-09-30 devnull threadnotify,
37 b2cfc4e2 2003-09-30 devnull threadid,
38 b2cfc4e2 2003-09-30 devnull threadpid,
39 df970459 2006-06-26 devnull threadpin,
40 df970459 2006-06-26 devnull threadunpin,
41 b2cfc4e2 2003-09-30 devnull threadsetgrp,
42 b2cfc4e2 2003-09-30 devnull threadsetname,
43 058b0118 2005-01-03 devnull threadsetstate,
44 058b0118 2005-01-03 devnull threadspawn,
45 9e4b56e7 2012-10-22 rsc threadspawnd,
46 e4d62adf 2005-01-18 devnull threadspawnl,
47 b2cfc4e2 2003-09-30 devnull threadwaitchan,
48 b2cfc4e2 2003-09-30 devnull yield \- thread and proc management
49 b2cfc4e2 2003-09-30 devnull .SH SYNOPSIS
50 b2cfc4e2 2003-09-30 devnull .PP
51 b2cfc4e2 2003-09-30 devnull .EX
52 b2cfc4e2 2003-09-30 devnull .ta 4n +4n +4n +4n +4n +4n +4n
53 b2cfc4e2 2003-09-30 devnull #include <u.h>
54 b2cfc4e2 2003-09-30 devnull #include <libc.h>
55 b2cfc4e2 2003-09-30 devnull #include <thread.h>
56 b2cfc4e2 2003-09-30 devnull .sp
57 b2cfc4e2 2003-09-30 devnull #define CHANEND 0
58 b2cfc4e2 2003-09-30 devnull #define CHANSND 1
59 b2cfc4e2 2003-09-30 devnull #define CHANRCV 2
60 b2cfc4e2 2003-09-30 devnull #define CHANNOP 3
61 b2cfc4e2 2003-09-30 devnull #define CHANNOBLK 4
62 b2cfc4e2 2003-09-30 devnull .sp
63 b2cfc4e2 2003-09-30 devnull .ta \w' 'u +\w'Channel 'u
64 b2cfc4e2 2003-09-30 devnull typedef struct Alt Alt;
65 b2cfc4e2 2003-09-30 devnull struct Alt {
66 b2cfc4e2 2003-09-30 devnull Channel *c;
67 b2cfc4e2 2003-09-30 devnull void *v;
68 b2cfc4e2 2003-09-30 devnull int op;
69 b2cfc4e2 2003-09-30 devnull Channel **tag;
70 b2cfc4e2 2003-09-30 devnull int entryno;
71 058b0118 2005-01-03 devnull char *name;
72 b2cfc4e2 2003-09-30 devnull };
73 b2cfc4e2 2003-09-30 devnull .fi
74 b2cfc4e2 2003-09-30 devnull .de XX
75 b5fdffee 2004-04-19 devnull .if t .sp 0.5
76 b5fdffee 2004-04-19 devnull .if n .sp
77 b2cfc4e2 2003-09-30 devnull ..
78 b2cfc4e2 2003-09-30 devnull .PP
79 b2cfc4e2 2003-09-30 devnull .nf
80 b2cfc4e2 2003-09-30 devnull .ft L
81 b2cfc4e2 2003-09-30 devnull .ta \w'\fLChannel* 'u +4n +4n +4n +4n
82 b2cfc4e2 2003-09-30 devnull void threadmain(int argc, char *argv[])
83 b2cfc4e2 2003-09-30 devnull int mainstacksize
84 b2cfc4e2 2003-09-30 devnull int proccreate(void (*fn)(void*), void *arg, uint stacksize)
85 b2cfc4e2 2003-09-30 devnull int threadcreate(void (*fn)(void*), void *arg, uint stacksize)
86 b2cfc4e2 2003-09-30 devnull void threadexits(char *status)
87 b2cfc4e2 2003-09-30 devnull void threadexitsall(char *status)
88 b2cfc4e2 2003-09-30 devnull void yield(void)
89 df970459 2006-06-26 devnull int threadpin(void)
90 df970459 2006-06-26 devnull int threadunpin(void)
91 b2cfc4e2 2003-09-30 devnull .XX
92 b2cfc4e2 2003-09-30 devnull int threadid(void)
93 b2cfc4e2 2003-09-30 devnull int threadgrp(void)
94 b2cfc4e2 2003-09-30 devnull int threadsetgrp(int group)
95 b2cfc4e2 2003-09-30 devnull int threadpid(int id)
96 b2cfc4e2 2003-09-30 devnull .XX
97 b2cfc4e2 2003-09-30 devnull int threadint(int id)
98 b2cfc4e2 2003-09-30 devnull int threadintgrp(int group)
99 b2cfc4e2 2003-09-30 devnull int threadkill(int id)
100 b2cfc4e2 2003-09-30 devnull int threadkillgrp(int group)
101 b2cfc4e2 2003-09-30 devnull .XX
102 b2cfc4e2 2003-09-30 devnull void threadsetname(char *name)
103 b2cfc4e2 2003-09-30 devnull char* threadgetname(void)
104 b2cfc4e2 2003-09-30 devnull .XX
105 b2cfc4e2 2003-09-30 devnull void** threaddata(void)
106 b2cfc4e2 2003-09-30 devnull void** procdata(void)
107 b2cfc4e2 2003-09-30 devnull .XX
108 b2cfc4e2 2003-09-30 devnull Channel* chancreate(int elsize, int nel)
109 b2cfc4e2 2003-09-30 devnull void chanfree(Channel *c)
110 b2cfc4e2 2003-09-30 devnull .XX
111 b2cfc4e2 2003-09-30 devnull int alt(Alt *alts)
112 b2cfc4e2 2003-09-30 devnull int recv(Channel *c, void *v)
113 b2cfc4e2 2003-09-30 devnull void* recvp(Channel *c)
114 b2cfc4e2 2003-09-30 devnull ulong recvul(Channel *c)
115 b2cfc4e2 2003-09-30 devnull int nbrecv(Channel *c, void *v)
116 b2cfc4e2 2003-09-30 devnull void* nbrecvp(Channel *c)
117 b2cfc4e2 2003-09-30 devnull ulong nbrecvul(Channel *c)
118 b2cfc4e2 2003-09-30 devnull int send(Channel *c, void *v)
119 b2cfc4e2 2003-09-30 devnull int sendp(Channel *c, void *v)
120 b2cfc4e2 2003-09-30 devnull int sendul(Channel *c, ulong v)
121 b2cfc4e2 2003-09-30 devnull int nbsend(Channel *c, void *v)
122 b2cfc4e2 2003-09-30 devnull int nbsendp(Channel *c, void *v)
123 b2cfc4e2 2003-09-30 devnull int nbsendul(Channel *c, ulong v)
124 b2cfc4e2 2003-09-30 devnull int chanprint(Channel *c, char *fmt, ...)
125 b2cfc4e2 2003-09-30 devnull .XX
126 e4d62adf 2005-01-18 devnull int threadspawnl(int fd[3], char *file, ...)
127 058b0118 2005-01-03 devnull int threadspawn(int fd[3], char *file, char *args[])
128 9e4b56e7 2012-10-22 rsc int threadspawnd(int fd[3], char *file, char *args[], char *dir)
129 058b0118 2005-01-03 devnull int threadexecl(Channel *cpid, int fd[3], char *file, ...)
130 058b0118 2005-01-03 devnull int threadexec(Channel *cpid, int fd[3], char *file, char *args[])
131 b2cfc4e2 2003-09-30 devnull Channel* threadwaitchan(void)
132 b2cfc4e2 2003-09-30 devnull .XX
133 b2cfc4e2 2003-09-30 devnull int threadnotify(int (*f)(void*, char*), int in)
134 b2cfc4e2 2003-09-30 devnull .EE
135 b2cfc4e2 2003-09-30 devnull .SH DESCRIPTION
136 b2cfc4e2 2003-09-30 devnull .PP
137 b2cfc4e2 2003-09-30 devnull The thread library provides parallel programming support similar to that
138 b2cfc4e2 2003-09-30 devnull of the languages
139 b2cfc4e2 2003-09-30 devnull Alef and Newsqueak.
140 b2cfc4e2 2003-09-30 devnull Threads
141 b2cfc4e2 2003-09-30 devnull and
142 b2cfc4e2 2003-09-30 devnull procs
143 b2cfc4e2 2003-09-30 devnull occupy a shared address space,
144 b2cfc4e2 2003-09-30 devnull communicating and synchronizing through
145 b2cfc4e2 2003-09-30 devnull .I channels
146 b2cfc4e2 2003-09-30 devnull and shared variables.
147 b2cfc4e2 2003-09-30 devnull .PP
148 b2cfc4e2 2003-09-30 devnull A
149 b2cfc4e2 2003-09-30 devnull .I proc
150 b2cfc4e2 2003-09-30 devnull is a Plan 9 process that contains one or more cooperatively scheduled
151 b2cfc4e2 2003-09-30 devnull .IR threads .
152 b2cfc4e2 2003-09-30 devnull Programs using threads must replace
153 b2cfc4e2 2003-09-30 devnull .I main
154 b2cfc4e2 2003-09-30 devnull by
155 b2cfc4e2 2003-09-30 devnull .IR threadmain .
156 b2cfc4e2 2003-09-30 devnull The thread library provides a
157 b2cfc4e2 2003-09-30 devnull .I main
158 b2cfc4e2 2003-09-30 devnull function that sets up a proc with a single thread executing
159 b2cfc4e2 2003-09-30 devnull .I threadmain
160 b2cfc4e2 2003-09-30 devnull on a stack of size
161 b2cfc4e2 2003-09-30 devnull .I mainstacksize
162 b2cfc4e2 2003-09-30 devnull (default eight kilobytes).
163 b2cfc4e2 2003-09-30 devnull To set
164 b2cfc4e2 2003-09-30 devnull .IR mainstacksize ,
165 b2cfc4e2 2003-09-30 devnull declare a global variable
166 b2cfc4e2 2003-09-30 devnull initialized to the desired value
167 b2cfc4e2 2003-09-30 devnull .RI ( e.g. ,
168 b2cfc4e2 2003-09-30 devnull .B int
169 b2cfc4e2 2003-09-30 devnull .B mainstacksize
170 b2cfc4e2 2003-09-30 devnull .B =
171 b2cfc4e2 2003-09-30 devnull .BR 1024 ).
172 b2cfc4e2 2003-09-30 devnull .PP
173 b2cfc4e2 2003-09-30 devnull .I Threadcreate
174 b2cfc4e2 2003-09-30 devnull creates a new thread in the calling proc, returning a unique integer
175 b2cfc4e2 2003-09-30 devnull identifying the thread; the thread
176 b2cfc4e2 2003-09-30 devnull executes
177 b2cfc4e2 2003-09-30 devnull .I fn(arg)
178 b2cfc4e2 2003-09-30 devnull on a stack of size
179 b2cfc4e2 2003-09-30 devnull .IR stacksize .
180 b2cfc4e2 2003-09-30 devnull Thread stacks are allocated in shared memory, making it valid to pass
181 b2cfc4e2 2003-09-30 devnull pointers to stack variables between threads and procs.
182 058b0118 2005-01-03 devnull .I Proccreate
183 b2cfc4e2 2003-09-30 devnull creates a new proc, and inside that proc creates
184 b2cfc4e2 2003-09-30 devnull a single thread as
185 b2cfc4e2 2003-09-30 devnull .I threadcreate
186 b2cfc4e2 2003-09-30 devnull would,
187 b2cfc4e2 2003-09-30 devnull returning the id of the created thread.
188 058b0118 2005-01-03 devnull .\" .I Procrfork
189 058b0118 2005-01-03 devnull .\" creates the new proc by calling
190 058b0118 2005-01-03 devnull .\" .B rfork
191 058b0118 2005-01-03 devnull .\" (see
192 058b0118 2005-01-03 devnull .\" .IR fork (3))
193 058b0118 2005-01-03 devnull .\" with flags
194 058b0118 2005-01-03 devnull .\" .BR RFPROC|RFMEM|RFNOWAIT| \fIrforkflag\fR.
195 058b0118 2005-01-03 devnull .\" (The thread library depends on all its procs
196 058b0118 2005-01-03 devnull .\" running in the same rendezvous group.
197 058b0118 2005-01-03 devnull .\" Do not include
198 058b0118 2005-01-03 devnull .\" .B RFREND
199 058b0118 2005-01-03 devnull .\" in
200 058b0118 2005-01-03 devnull .\" .IR rforkflag .)
201 058b0118 2005-01-03 devnull .\" .I Proccreate
202 058b0118 2005-01-03 devnull .\" is identical to
203 058b0118 2005-01-03 devnull .\" .I procrfork
204 058b0118 2005-01-03 devnull .\" with
205 058b0118 2005-01-03 devnull .\" .I rforkflag
206 058b0118 2005-01-03 devnull .\" set to zero.
207 b2cfc4e2 2003-09-30 devnull Be aware that the calling thread may continue
208 b2cfc4e2 2003-09-30 devnull execution before
209 b2cfc4e2 2003-09-30 devnull the newly created proc and thread
210 b2cfc4e2 2003-09-30 devnull are scheduled.
211 b2cfc4e2 2003-09-30 devnull Because of this,
212 b2cfc4e2 2003-09-30 devnull .I arg
213 b2cfc4e2 2003-09-30 devnull should not point to data on the stack of a function that could
214 b2cfc4e2 2003-09-30 devnull return before the new process is scheduled.
215 b2cfc4e2 2003-09-30 devnull .PP
216 b2cfc4e2 2003-09-30 devnull .I Threadexits
217 b2cfc4e2 2003-09-30 devnull terminates the calling thread.
218 b2cfc4e2 2003-09-30 devnull If the thread is the last in its proc,
219 b2cfc4e2 2003-09-30 devnull .I threadexits
220 b2cfc4e2 2003-09-30 devnull also terminates the proc, using
221 b2cfc4e2 2003-09-30 devnull .I status
222 b2cfc4e2 2003-09-30 devnull as the exit status.
223 b2cfc4e2 2003-09-30 devnull .I Threadexitsall
224 b2cfc4e2 2003-09-30 devnull terminates all procs in the program,
225 b2cfc4e2 2003-09-30 devnull using
226 b2cfc4e2 2003-09-30 devnull .I status
227 b2cfc4e2 2003-09-30 devnull as the exit status.
228 b2cfc4e2 2003-09-30 devnull .PP
229 058b0118 2005-01-03 devnull When the last thread in
230 058b0118 2005-01-03 devnull .IR threadmain 's
231 058b0118 2005-01-03 devnull proc exits, the program will appear to its parent to have exited.
232 058b0118 2005-01-03 devnull The remaining procs will still run together, but as a background program.
233 058b0118 2005-01-03 devnull .PP
234 b2cfc4e2 2003-09-30 devnull The threads in a proc are coroutines, scheduled nonpreemptively
235 b2cfc4e2 2003-09-30 devnull in a round-robin fashion.
236 b2cfc4e2 2003-09-30 devnull A thread must explicitly relinquish control of the processor
237 b2cfc4e2 2003-09-30 devnull before another thread in the same proc is run.
238 b2cfc4e2 2003-09-30 devnull Calls that do this are
239 b2cfc4e2 2003-09-30 devnull .IR yield ,
240 b2cfc4e2 2003-09-30 devnull .IR proccreate ,
241 058b0118 2005-01-03 devnull .IR threadexec ,
242 058b0118 2005-01-03 devnull .IR threadexecl ,
243 b2cfc4e2 2003-09-30 devnull .IR threadexits ,
244 058b0118 2005-01-03 devnull .IR threadspawn ,
245 9e4b56e7 2012-10-22 rsc .IR threadspawnd ,
246 9e4b56e7 2012-10-22 rsc .IR threadspawnl ,
247 b2cfc4e2 2003-09-30 devnull .IR alt ,
248 b2cfc4e2 2003-09-30 devnull .IR send ,
249 b2cfc4e2 2003-09-30 devnull and
250 b2cfc4e2 2003-09-30 devnull .I recv
251 b2cfc4e2 2003-09-30 devnull (and the calls related to
252 b2cfc4e2 2003-09-30 devnull .I send
253 b2cfc4e2 2003-09-30 devnull and
254 b2cfc4e2 2003-09-30 devnull .IR recv \(emsee
255 b2cfc4e2 2003-09-30 devnull their descriptions further on).
256 b2cfc4e2 2003-09-30 devnull Procs are scheduled by the operating system.
257 b2cfc4e2 2003-09-30 devnull Therefore, threads in different procs can preempt one another
258 b2cfc4e2 2003-09-30 devnull in arbitrary ways and should synchronize their
259 b2cfc4e2 2003-09-30 devnull actions using
260 b2cfc4e2 2003-09-30 devnull .B qlocks
261 b2cfc4e2 2003-09-30 devnull (see
262 bf8a59fa 2004-04-11 devnull .IR lock (3))
263 b2cfc4e2 2003-09-30 devnull or channel communication.
264 b2cfc4e2 2003-09-30 devnull System calls such as
265 bf8a59fa 2004-04-11 devnull .IR read (3)
266 b2cfc4e2 2003-09-30 devnull block the entire proc;
267 b2cfc4e2 2003-09-30 devnull all threads in a proc block until the system call finishes.
268 df970459 2006-06-26 devnull .PP
269 df970459 2006-06-26 devnull .I Threadpin
270 df970459 2006-06-26 devnull disables scheduling inside a proc, `pinning' the current
271 df970459 2006-06-26 devnull thread as the only runnable one in the current proc.
272 df970459 2006-06-26 devnull .I Threadunpin
273 df970459 2006-06-26 devnull reenables scheduling, allowing other procs to run once the current
274 df970459 2006-06-26 devnull thread relinquishes the processor.
275 df970459 2006-06-26 devnull .I Threadpin
276 df970459 2006-06-26 devnull and
277 df970459 2006-06-26 devnull .I threadunpin
278 df970459 2006-06-26 devnull can lead to deadlock.
279 df970459 2006-06-26 devnull Used carefully, they can make library routines that use
280 df970459 2006-06-26 devnull .B qlocks
281 df970459 2006-06-26 devnull appear atomic relative to the current proc, like a system call.
282 b2cfc4e2 2003-09-30 devnull .PP
283 b2cfc4e2 2003-09-30 devnull As mentioned above, each thread has a unique integer thread id.
284 b2cfc4e2 2003-09-30 devnull Thread ids are not reused; they are unique across the life of the program.
285 b2cfc4e2 2003-09-30 devnull .I Threadid
286 b2cfc4e2 2003-09-30 devnull returns the id for the current thread.
287 b2cfc4e2 2003-09-30 devnull Each thread also has a thread group id.
288 b2cfc4e2 2003-09-30 devnull The initial thread has a group id of zero.
289 b2cfc4e2 2003-09-30 devnull Each new thread inherits the group id of
290 b2cfc4e2 2003-09-30 devnull the thread that created it.
291 b2cfc4e2 2003-09-30 devnull .I Threadgrp
292 b2cfc4e2 2003-09-30 devnull returns the group id for the current thread;
293 b2cfc4e2 2003-09-30 devnull .I threadsetgrp
294 b2cfc4e2 2003-09-30 devnull sets it.
295 b2cfc4e2 2003-09-30 devnull .I Threadpid
296 b2cfc4e2 2003-09-30 devnull returns the pid of the Plan 9 process containing
297 b2cfc4e2 2003-09-30 devnull the thread identified by
298 b2cfc4e2 2003-09-30 devnull .IR id ,
299 b2cfc4e2 2003-09-30 devnull or \-1
300 b2cfc4e2 2003-09-30 devnull if no such thread is found.
301 b2cfc4e2 2003-09-30 devnull .PP
302 b2cfc4e2 2003-09-30 devnull .I Threadint
303 b2cfc4e2 2003-09-30 devnull interrupts a thread that is blocked in a channel operation
304 b2cfc4e2 2003-09-30 devnull or system call.
305 b2cfc4e2 2003-09-30 devnull .I Threadintgrp
306 b2cfc4e2 2003-09-30 devnull interrupts all threads with the given group id.
307 b2cfc4e2 2003-09-30 devnull .I Threadkill
308 b2cfc4e2 2003-09-30 devnull marks a thread to die when it next relinquishes the processor
309 b2cfc4e2 2003-09-30 devnull (via one of the calls listed above).
310 b2cfc4e2 2003-09-30 devnull If the thread is blocked in a channel operation or system call,
311 b2cfc4e2 2003-09-30 devnull it is also interrupted.
312 b2cfc4e2 2003-09-30 devnull .I Threadkillgrp
313 b2cfc4e2 2003-09-30 devnull kills all threads with the given group id.
314 b2cfc4e2 2003-09-30 devnull Note that
315 b2cfc4e2 2003-09-30 devnull .I threadkill
316 b2cfc4e2 2003-09-30 devnull and
317 b2cfc4e2 2003-09-30 devnull .I threadkillgrp
318 b2cfc4e2 2003-09-30 devnull will not terminate a thread that never relinquishes
319 b2cfc4e2 2003-09-30 devnull the processor.
320 b2cfc4e2 2003-09-30 devnull .PP
321 b2cfc4e2 2003-09-30 devnull Primarily for debugging,
322 b2cfc4e2 2003-09-30 devnull threads can have string names associated with them.
323 b2cfc4e2 2003-09-30 devnull .I Threadgetname
324 b2cfc4e2 2003-09-30 devnull returns the current thread's name;
325 b2cfc4e2 2003-09-30 devnull .I threadsetname
326 b2cfc4e2 2003-09-30 devnull sets it.
327 b2cfc4e2 2003-09-30 devnull The pointer returned by
328 b2cfc4e2 2003-09-30 devnull .I threadgetname
329 b2cfc4e2 2003-09-30 devnull is only valid until the next call to
330 b2cfc4e2 2003-09-30 devnull .IR threadsetname .
331 b2cfc4e2 2003-09-30 devnull .PP
332 058b0118 2005-01-03 devnull Also for debugging,
333 058b0118 2005-01-03 devnull threads have a string state associated with them.
334 058b0118 2005-01-03 devnull .I Threadsetstate
335 058b0118 2005-01-03 devnull sets the state string.
336 058b0118 2005-01-03 devnull There is no
337 058b0118 2005-01-03 devnull .IR threadgetstate ;
338 058b0118 2005-01-03 devnull since the thread scheduler resets the state to
339 058b0118 2005-01-03 devnull .B Running
340 058b0118 2005-01-03 devnull every time it runs the thread,
341 058b0118 2005-01-03 devnull it is only useful for debuggers to inspect the state.
342 058b0118 2005-01-03 devnull .PP
343 b2cfc4e2 2003-09-30 devnull .I Threaddata
344 b2cfc4e2 2003-09-30 devnull returns a pointer to a per-thread pointer
345 b2cfc4e2 2003-09-30 devnull that may be modified by threaded programs for
346 b2cfc4e2 2003-09-30 devnull per-thread storage.
347 b2cfc4e2 2003-09-30 devnull Similarly,
348 b2cfc4e2 2003-09-30 devnull .I procdata
349 b2cfc4e2 2003-09-30 devnull returns a pointer to a per-proc pointer.
350 b2cfc4e2 2003-09-30 devnull .PP
351 058b0118 2005-01-03 devnull .I Threadexecl
352 b2cfc4e2 2003-09-30 devnull and
353 058b0118 2005-01-03 devnull .I threadexec
354 b2cfc4e2 2003-09-30 devnull are threaded analogues of
355 b2cfc4e2 2003-09-30 devnull .I exec
356 b2cfc4e2 2003-09-30 devnull and
357 b2cfc4e2 2003-09-30 devnull .I execl
358 b2cfc4e2 2003-09-30 devnull (see
359 bf8a59fa 2004-04-11 devnull .IR exec (3));
360 b2cfc4e2 2003-09-30 devnull on success,
361 058b0118 2005-01-03 devnull they replace the calling thread
362 b2cfc4e2 2003-09-30 devnull and invoke the external program, never returning.
363 058b0118 2005-01-03 devnull (Unlike on Plan 9, the calling thread need not be the only thread in its proc\(emthe other
364 058b0118 2005-01-03 devnull threads will continue executing.)
365 b2cfc4e2 2003-09-30 devnull On error, they return \-1.
366 b2cfc4e2 2003-09-30 devnull If
367 b2cfc4e2 2003-09-30 devnull .I cpid
368 b2cfc4e2 2003-09-30 devnull is not null, the pid of the invoked program
369 b2cfc4e2 2003-09-30 devnull will be sent along
370 b2cfc4e2 2003-09-30 devnull .I cpid
371 058b0118 2005-01-03 devnull (using
372 058b0118 2005-01-03 devnull .IR sendul )
373 b2cfc4e2 2003-09-30 devnull once the program has been started, or \-1 will be sent if an
374 b2cfc4e2 2003-09-30 devnull error occurs.
375 058b0118 2005-01-03 devnull .I Threadexec
376 b2cfc4e2 2003-09-30 devnull and
377 058b0118 2005-01-03 devnull .I threadexecl
378 b2cfc4e2 2003-09-30 devnull will not access their arguments after sending a result
379 b2cfc4e2 2003-09-30 devnull along
380 b2cfc4e2 2003-09-30 devnull .IR cpid .
381 b2cfc4e2 2003-09-30 devnull Thus, programs that malloc the
382 b2cfc4e2 2003-09-30 devnull .I argv
383 b2cfc4e2 2003-09-30 devnull passed to
384 058b0118 2005-01-03 devnull .I threadexec
385 b2cfc4e2 2003-09-30 devnull can safely free it once they have
386 b2cfc4e2 2003-09-30 devnull received the
387 b2cfc4e2 2003-09-30 devnull .I cpid
388 b2cfc4e2 2003-09-30 devnull response.
389 058b0118 2005-01-03 devnull .PP
390 058b0118 2005-01-03 devnull .I Threadexecl
391 058b0118 2005-01-03 devnull and
392 058b0118 2005-01-03 devnull .I threadexec
393 058b0118 2005-01-03 devnull will duplicate
394 058b0118 2005-01-03 devnull (see
395 058b0118 2005-01-03 devnull .IR dup (3))
396 058b0118 2005-01-03 devnull the three file descriptors in
397 058b0118 2005-01-03 devnull .I fd
398 058b0118 2005-01-03 devnull onto standard input, output, and error for the external program
399 058b0118 2005-01-03 devnull and then close them in the calling thread.
400 058b0118 2005-01-03 devnull Beware of code that sets
401 058b0118 2005-01-03 devnull .IP
402 058b0118 2005-01-03 devnull .EX
403 058b0118 2005-01-03 devnull fd[0] = 0;
404 058b0118 2005-01-03 devnull fd[1] = 1;
405 058b0118 2005-01-03 devnull fd[2] = 2;
406 058b0118 2005-01-03 devnull .EE
407 c8b6342d 2005-01-13 devnull .LP
408 058b0118 2005-01-03 devnull to use the current standard files. The correct code is
409 058b0118 2005-01-03 devnull .IP
410 058b0118 2005-01-03 devnull .EX
411 058b0118 2005-01-03 devnull fd[0] = dup(0, -1);
412 058b0118 2005-01-03 devnull fd[1] = dup(1, -1);
413 058b0118 2005-01-03 devnull fd[2] = dup(2, -1);
414 058b0118 2005-01-03 devnull .EE
415 058b0118 2005-01-03 devnull .PP
416 e4d62adf 2005-01-18 devnull .I Threadspawnl
417 e4d62adf 2005-01-18 devnull and
418 e4d62adf 2005-01-18 devnull .I threadspawn
419 e4d62adf 2005-01-18 devnull are like
420 e4d62adf 2005-01-18 devnull .I threadexecl
421 e4d62adf 2005-01-18 devnull and
422 058b0118 2005-01-03 devnull .I threadexec
423 e4d62adf 2005-01-18 devnull but do not replace the current thread.
424 e4d62adf 2005-01-18 devnull They return the pid of the invoked program on success, or
425 058b0118 2005-01-03 devnull \-1 on error.
426 9e4b56e7 2012-10-22 rsc .I Threadspawnd
427 9e4b56e7 2012-10-22 rsc is like
428 9e4b56e7 2012-10-22 rsc .I threadspawn
429 9e4b56e7 2012-10-22 rsc but takes as its final argument the directory in which to run the invoked program.
430 9e4b56e7 2012-10-22 rsc The child will attempt to change into that directory before running the program,
431 9e4b56e7 2012-10-22 rsc but it is only best effort: failure to change into the directory does not
432 9e4b56e7 2012-10-22 rsc stop the running of the program.
433 058b0118 2005-01-03 devnull .PP
434 b2cfc4e2 2003-09-30 devnull .I Threadwaitchan
435 b2cfc4e2 2003-09-30 devnull returns a channel of pointers to
436 b2cfc4e2 2003-09-30 devnull .B Waitmsg
437 b2cfc4e2 2003-09-30 devnull structures (see
438 bf8a59fa 2004-04-11 devnull .IR wait (3)).
439 b2cfc4e2 2003-09-30 devnull When an exec'ed process exits, a pointer to a
440 b2cfc4e2 2003-09-30 devnull .B Waitmsg
441 b2cfc4e2 2003-09-30 devnull is sent to this channel.
442 b2cfc4e2 2003-09-30 devnull These
443 b2cfc4e2 2003-09-30 devnull .B Waitmsg
444 b2cfc4e2 2003-09-30 devnull structures have been allocated with
445 bf8a59fa 2004-04-11 devnull .IR malloc (3)
446 b2cfc4e2 2003-09-30 devnull and should be freed after use.
447 b2cfc4e2 2003-09-30 devnull .PP
448 b2cfc4e2 2003-09-30 devnull A
449 b2cfc4e2 2003-09-30 devnull .B Channel
450 b2cfc4e2 2003-09-30 devnull is a buffered or unbuffered queue for fixed-size messages.
451 b2cfc4e2 2003-09-30 devnull Procs and threads
452 b2cfc4e2 2003-09-30 devnull .I send
453 b2cfc4e2 2003-09-30 devnull messages into the channel and
454 b2cfc4e2 2003-09-30 devnull .I recv
455 b2cfc4e2 2003-09-30 devnull messages from the channel. If the channel is unbuffered, a
456 b2cfc4e2 2003-09-30 devnull .I send
457 b2cfc4e2 2003-09-30 devnull operation blocks until the corresponding
458 b2cfc4e2 2003-09-30 devnull .I recv
459 b2cfc4e2 2003-09-30 devnull operation occurs and
460 b2cfc4e2 2003-09-30 devnull .IR "vice versa" .
461 9ea7f9d8 2009-04-30 rsc .IR Chancreate
462 9ea7f9d8 2009-04-30 rsc allocates a new channel
463 b2cfc4e2 2003-09-30 devnull for messages of size
464 b2cfc4e2 2003-09-30 devnull .I elsize
465 b2cfc4e2 2003-09-30 devnull and with a buffer holding
466 b2cfc4e2 2003-09-30 devnull .I nel
467 b2cfc4e2 2003-09-30 devnull messages.
468 b2cfc4e2 2003-09-30 devnull If
469 b2cfc4e2 2003-09-30 devnull .I nel
470 b2cfc4e2 2003-09-30 devnull is zero, the channel is unbuffered.
471 b2cfc4e2 2003-09-30 devnull .I Chanfree
472 b2cfc4e2 2003-09-30 devnull frees a channel that is no longer used.
473 b2cfc4e2 2003-09-30 devnull .I Chanfree
474 b2cfc4e2 2003-09-30 devnull can be called by either sender or receiver after the last item has been
475 b2cfc4e2 2003-09-30 devnull sent or received. Freeing the channel will be delayed if there is a thread
476 b2cfc4e2 2003-09-30 devnull blocked on it until that thread unblocks (but
477 b2cfc4e2 2003-09-30 devnull .I chanfree
478 b2cfc4e2 2003-09-30 devnull returns immediately).
479 b2cfc4e2 2003-09-30 devnull .PP
480 058b0118 2005-01-03 devnull The
481 058b0118 2005-01-03 devnull .B name
482 058b0118 2005-01-03 devnull element in the
483 058b0118 2005-01-03 devnull .B Channel
484 058b0118 2005-01-03 devnull structure is a description intended for use in debugging.
485 058b0118 2005-01-03 devnull .I Chansetname
486 058b0118 2005-01-03 devnull sets the name.
487 058b0118 2005-01-03 devnull .PP
488 b2cfc4e2 2003-09-30 devnull .I Send
489 b2cfc4e2 2003-09-30 devnull sends the element pointed at by
490 b2cfc4e2 2003-09-30 devnull .I v
491 b2cfc4e2 2003-09-30 devnull to the channel
492 b2cfc4e2 2003-09-30 devnull .IR c .
493 b2cfc4e2 2003-09-30 devnull If
494 b2cfc4e2 2003-09-30 devnull .I v
495 b2cfc4e2 2003-09-30 devnull is null, zeros are sent.
496 b2cfc4e2 2003-09-30 devnull .I Recv
497 b2cfc4e2 2003-09-30 devnull receives an element from
498 b2cfc4e2 2003-09-30 devnull .I c
499 b2cfc4e2 2003-09-30 devnull and stores it in
500 b2cfc4e2 2003-09-30 devnull .IR v .
501 b2cfc4e2 2003-09-30 devnull If
502 b2cfc4e2 2003-09-30 devnull .I v
503 b2cfc4e2 2003-09-30 devnull is null,
504 b2cfc4e2 2003-09-30 devnull the received value is discarded.
505 b2cfc4e2 2003-09-30 devnull .I Send
506 b2cfc4e2 2003-09-30 devnull and
507 b2cfc4e2 2003-09-30 devnull .I recv
508 b2cfc4e2 2003-09-30 devnull return 1 on success, \-1 if interrupted.
509 b2cfc4e2 2003-09-30 devnull .I Nbsend
510 b2cfc4e2 2003-09-30 devnull and
511 b2cfc4e2 2003-09-30 devnull .I nbrecv
512 b2cfc4e2 2003-09-30 devnull behave similarly, but return 0 rather than blocking.
513 b2cfc4e2 2003-09-30 devnull .PP
514 b2cfc4e2 2003-09-30 devnull .IR Sendp ,
515 b2cfc4e2 2003-09-30 devnull .IR nbsendp ,
516 b2cfc4e2 2003-09-30 devnull .IR sendul ,
517 b2cfc4e2 2003-09-30 devnull and
518 b2cfc4e2 2003-09-30 devnull .I nbsendul
519 b2cfc4e2 2003-09-30 devnull send a pointer or an unsigned long; the channel must
520 b2cfc4e2 2003-09-30 devnull have been initialized with the appropriate
521 b2cfc4e2 2003-09-30 devnull .IR elsize .
522 b2cfc4e2 2003-09-30 devnull .IR Recvp ,
523 b2cfc4e2 2003-09-30 devnull .IR nbrecvp ,
524 b2cfc4e2 2003-09-30 devnull .IR recvul ,
525 b2cfc4e2 2003-09-30 devnull and
526 b2cfc4e2 2003-09-30 devnull .I nbrecvul
527 b2cfc4e2 2003-09-30 devnull receive a pointer or an unsigned long;
528 b2cfc4e2 2003-09-30 devnull they return zero when a zero is received,
529 b2cfc4e2 2003-09-30 devnull when interrupted, or
530 b2cfc4e2 2003-09-30 devnull (for
531 b2cfc4e2 2003-09-30 devnull .I nbrecvp
532 b2cfc4e2 2003-09-30 devnull and
533 b2cfc4e2 2003-09-30 devnull .IR nbrecvul )
534 b2cfc4e2 2003-09-30 devnull when the operation would have blocked.
535 b2cfc4e2 2003-09-30 devnull To distinguish between these three cases,
536 b2cfc4e2 2003-09-30 devnull use
537 b2cfc4e2 2003-09-30 devnull .I recv
538 b2cfc4e2 2003-09-30 devnull or
539 b2cfc4e2 2003-09-30 devnull .IR nbrecv .
540 b2cfc4e2 2003-09-30 devnull .PP
541 b2cfc4e2 2003-09-30 devnull .I Alt
542 b2cfc4e2 2003-09-30 devnull can be used to recv from or send to one of a number of channels,
543 b2cfc4e2 2003-09-30 devnull as directed by an array of
544 b2cfc4e2 2003-09-30 devnull .B Alt
545 b2cfc4e2 2003-09-30 devnull structures,
546 b2cfc4e2 2003-09-30 devnull each of which describes a potential send or receive operation.
547 b2cfc4e2 2003-09-30 devnull In an
548 b2cfc4e2 2003-09-30 devnull .B Alt
549 b2cfc4e2 2003-09-30 devnull structure,
550 b2cfc4e2 2003-09-30 devnull .B c
551 b2cfc4e2 2003-09-30 devnull is the channel;
552 b2cfc4e2 2003-09-30 devnull .B v
553 b2cfc4e2 2003-09-30 devnull the value pointer (which may be null); and
554 b2cfc4e2 2003-09-30 devnull .B op
555 b2cfc4e2 2003-09-30 devnull the operation:
556 b2cfc4e2 2003-09-30 devnull .B CHANSND
557 b2cfc4e2 2003-09-30 devnull for a send operation,
558 b2cfc4e2 2003-09-30 devnull .B CHANRECV
559 b2cfc4e2 2003-09-30 devnull for a recv operation;
560 b2cfc4e2 2003-09-30 devnull .B CHANNOP
561 b2cfc4e2 2003-09-30 devnull for no operation
562 b2cfc4e2 2003-09-30 devnull (useful
563 b2cfc4e2 2003-09-30 devnull when
564 b2cfc4e2 2003-09-30 devnull .I alt
565 b2cfc4e2 2003-09-30 devnull is called with a varying set of operations).
566 b2cfc4e2 2003-09-30 devnull The array of
567 b2cfc4e2 2003-09-30 devnull .B Alt
568 b2cfc4e2 2003-09-30 devnull structures is terminated by an entry with
569 b2cfc4e2 2003-09-30 devnull .I op
570 b2cfc4e2 2003-09-30 devnull .B CHANEND
571 b2cfc4e2 2003-09-30 devnull or
572 b2cfc4e2 2003-09-30 devnull .BR CHANNOBLK .
573 b2cfc4e2 2003-09-30 devnull If at least one
574 b2cfc4e2 2003-09-30 devnull .B Alt
575 b2cfc4e2 2003-09-30 devnull structure can proceed, one of them is
576 b2cfc4e2 2003-09-30 devnull chosen at random to be executed.
577 b2cfc4e2 2003-09-30 devnull .I Alt
578 b2cfc4e2 2003-09-30 devnull returns the index of the chosen structure.
579 b2cfc4e2 2003-09-30 devnull If no operations can proceed and the list is terminated with
580 b2cfc4e2 2003-09-30 devnull .BR CHANNOBLK ,
581 b2cfc4e2 2003-09-30 devnull .I alt
582 b2cfc4e2 2003-09-30 devnull returns the index of the terminating
583 b2cfc4e2 2003-09-30 devnull .B CHANNOBLK
584 b2cfc4e2 2003-09-30 devnull structure.
585 b2cfc4e2 2003-09-30 devnull Otherwise,
586 b2cfc4e2 2003-09-30 devnull .I alt
587 b2cfc4e2 2003-09-30 devnull blocks until one of the operations can proceed,
588 b2cfc4e2 2003-09-30 devnull eventually returning the index of the structure executes.
589 b2cfc4e2 2003-09-30 devnull .I Alt
590 b2cfc4e2 2003-09-30 devnull returns \-1 when interrupted.
591 b2cfc4e2 2003-09-30 devnull The
592 b2cfc4e2 2003-09-30 devnull .B tag
593 b2cfc4e2 2003-09-30 devnull and
594 b2cfc4e2 2003-09-30 devnull .B entryno
595 b2cfc4e2 2003-09-30 devnull fields in the
596 b2cfc4e2 2003-09-30 devnull .B Alt
597 b2cfc4e2 2003-09-30 devnull structure are used internally by
598 b2cfc4e2 2003-09-30 devnull .I alt
599 b2cfc4e2 2003-09-30 devnull and need not be initialized.
600 b2cfc4e2 2003-09-30 devnull They are not used between
601 b2cfc4e2 2003-09-30 devnull .I alt
602 b2cfc4e2 2003-09-30 devnull calls.
603 b2cfc4e2 2003-09-30 devnull .PP
604 b2cfc4e2 2003-09-30 devnull .I Chanprint
605 b2cfc4e2 2003-09-30 devnull formats its arguments in the manner of
606 bf8a59fa 2004-04-11 devnull .IR print (3)
607 b2cfc4e2 2003-09-30 devnull and sends the result to the channel
608 b2cfc4e2 2003-09-30 devnull .IR c.
609 b2cfc4e2 2003-09-30 devnull The string delivered by
610 b2cfc4e2 2003-09-30 devnull .I chanprint
611 b2cfc4e2 2003-09-30 devnull is allocated with
612 bf8a59fa 2004-04-11 devnull .IR malloc (3)
613 b2cfc4e2 2003-09-30 devnull and should be freed upon receipt.
614 b2cfc4e2 2003-09-30 devnull .PP
615 b2cfc4e2 2003-09-30 devnull Thread library functions do not return on failure;
616 b2cfc4e2 2003-09-30 devnull if errors occur, the entire program is aborted.
617 b2cfc4e2 2003-09-30 devnull .PP
618 b2cfc4e2 2003-09-30 devnull Threaded programs should use
619 b2cfc4e2 2003-09-30 devnull .I threadnotify
620 b2cfc4e2 2003-09-30 devnull in place of
621 b2cfc4e2 2003-09-30 devnull .I atnotify
622 b2cfc4e2 2003-09-30 devnull (see
623 bf8a59fa 2004-04-11 devnull .IR notify (3)).
624 b2cfc4e2 2003-09-30 devnull .PP
625 b2cfc4e2 2003-09-30 devnull It is safe to use
626 058b0118 2005-01-03 devnull .IR sysfatal (3)
627 b2cfc4e2 2003-09-30 devnull in threaded programs.
628 b2cfc4e2 2003-09-30 devnull .I Sysfatal
629 b2cfc4e2 2003-09-30 devnull will print the error string and call
630 b2cfc4e2 2003-09-30 devnull .IR threadexitsall .
631 b2cfc4e2 2003-09-30 devnull .PP
632 058b0118 2005-01-03 devnull It is not safe to call
633 b2cfc4e2 2003-09-30 devnull .IR rfork
634 058b0118 2005-01-03 devnull in a threaded program, except to call
635 058b0118 2005-01-03 devnull .B rfork(RFNOTEG)
636 058b0118 2005-01-03 devnull from the main proc before any other procs have been created.
637 058b0118 2005-01-03 devnull To create new processes, use
638 058b0118 2005-01-03 devnull .IR proccreate .
639 058b0118 2005-01-03 devnull .\" .PP
640 058b0118 2005-01-03 devnull .\" It is safe to use
641 058b0118 2005-01-03 devnull .\" .IR rfork
642 058b0118 2005-01-03 devnull .\" (see
643 058b0118 2005-01-03 devnull .\" .IR fork (3))
644 058b0118 2005-01-03 devnull .\" to manage the namespace, file descriptors, note group, and environment of a
645 058b0118 2005-01-03 devnull .\" single process.
646 058b0118 2005-01-03 devnull .\" That is, it is safe to call
647 058b0118 2005-01-03 devnull .\" .I rfork
648 058b0118 2005-01-03 devnull .\" with the flags
649 058b0118 2005-01-03 devnull .\" .BR RFNAMEG ,
650 058b0118 2005-01-03 devnull .\" .BR RFFDG ,
651 058b0118 2005-01-03 devnull .\" .BR RFCFDG ,
652 058b0118 2005-01-03 devnull .\" .BR RFNOTEG ,
653 058b0118 2005-01-03 devnull .\" .BR RFENVG ,
654 058b0118 2005-01-03 devnull .\" and
655 058b0118 2005-01-03 devnull .\" .BR RFCENVG.
656 058b0118 2005-01-03 devnull .\" (To create new processes, use
657 058b0118 2005-01-03 devnull .\" .I proccreate
658 058b0118 2005-01-03 devnull .\" and
659 058b0118 2005-01-03 devnull .\" .IR procrfork .)
660 058b0118 2005-01-03 devnull .\" As mentioned above,
661 058b0118 2005-01-03 devnull .\" the thread library depends on all procs being in the
662 058b0118 2005-01-03 devnull .\" same rendezvous group; do not change the rendezvous
663 058b0118 2005-01-03 devnull .\" group with
664 058b0118 2005-01-03 devnull .\" .IR rfork .
665 b2cfc4e2 2003-09-30 devnull .SH FILES
666 c3674de4 2005-01-11 devnull .B \*9/acid/thread
667 b2cfc4e2 2003-09-30 devnull contains useful
668 b2cfc4e2 2003-09-30 devnull .IR acid (1)
669 b2cfc4e2 2003-09-30 devnull functions for debugging threaded programs.
670 b2cfc4e2 2003-09-30 devnull .PP
671 c3674de4 2005-01-11 devnull .B \*9/src/libthread/test
672 058b0118 2005-01-03 devnull contains some example programs.
673 b2cfc4e2 2003-09-30 devnull .SH SOURCE
674 c3674de4 2005-01-11 devnull .B \*9/src/libthread
675 b2cfc4e2 2003-09-30 devnull .SH SEE ALSO
676 bf8a59fa 2004-04-11 devnull .IR intro (3),
677 bf8a59fa 2004-04-11 devnull .IR ioproc (3)
678 058b0118 2005-01-03 devnull .SH BUGS
679 058b0118 2005-01-03 devnull To avoid name conflicts,
680 058b0118 2005-01-03 devnull .IR alt ,
681 058b0118 2005-01-03 devnull .IR nbrecv ,
682 058b0118 2005-01-03 devnull .IR nbrecvp ,
683 058b0118 2005-01-03 devnull .IR nbrecvul ,
684 058b0118 2005-01-03 devnull .IR nbsend ,
685 058b0118 2005-01-03 devnull .IR nbsendp ,
686 058b0118 2005-01-03 devnull .IR nbsendul ,
687 058b0118 2005-01-03 devnull .IR recv ,
688 058b0118 2005-01-03 devnull .IR recvp ,
689 058b0118 2005-01-03 devnull .IR recvul ,
690 058b0118 2005-01-03 devnull .IR send ,
691 058b0118 2005-01-03 devnull .IR sendp ,
692 058b0118 2005-01-03 devnull and
693 058b0118 2005-01-03 devnull .IR sendul
694 058b0118 2005-01-03 devnull are defined as macros that expand to
695 058b0118 2005-01-03 devnull .IR chanalt ,
696 058b0118 2005-01-03 devnull .IR channbrecv ,
697 058b0118 2005-01-03 devnull and so on.
698 c8b6342d 2005-01-13 devnull .I Yield
699 058b0118 2005-01-03 devnull is defined as a macro that expands to
700 058b0118 2005-01-03 devnull .IR threadyield .
701 c8b6342d 2005-01-13 devnull See
702 c8b6342d 2005-01-13 devnull .IR intro (3).
703 058b0118 2005-01-03 devnull .PP
704 e1df0680 2008-07-21 t.lainson Threadint,
705 e1df0680 2008-07-21 t.lainson threadintgrp,
706 e1df0680 2008-07-21 t.lainson threadkill,
707 e1df0680 2008-07-21 t.lainson threadkillgrp and threadpid are unimplemented.
708 e1df0680 2008-07-21 t.lainson .PP
709 058b0118 2005-01-03 devnull The implementation of
710 058b0118 2005-01-03 devnull .I threadnotify
711 058b0118 2005-01-03 devnull may not be correct.
712 33488b09 2005-03-18 devnull .PP
713 33488b09 2005-03-18 devnull There appears to be a race in the Linux NPTL
714 33488b09 2005-03-18 devnull implementation of
715 33488b09 2005-03-18 devnull .I pthread_exit .
716 33488b09 2005-03-18 devnull Call
717 33488b09 2005-03-18 devnull .I threadexitsall
718 33488b09 2005-03-18 devnull rather than coordinating a simultaneous
719 33488b09 2005-03-18 devnull .I threadexits
720 33488b09 2005-03-18 devnull among many threads.