pthreads : questions about concurrency and lifetime
- From: Garrett Cooper <youshi10@xxxxxxxxxxxxxxxx>
- Date: Tue, 28 Nov 2006 13:33:06 -0800
Hello once again,
Just wondering about pthreads now. I know that the lifetime (scope) of a regular procedural function in C is simple.. it's from the top of the function body to the bottom of the function body (assuming no infinite loops are injected). Example:
(void*) function(void*) {/* lifetime of function is here. */ }
However looking over pthread(3), there are a number of different functions for killing threads and exiting child threads, in order terminate child threads (and maybe to get back to the main thread of execution in a program).
So my question is, once the end of a function body is reached that was made using pthread_create(), does the thread exit and 'destroy' itself or do I need to do 'manual' cleanup, i.e. run pthread_detach(3), pthread_exit(3), or pthread_kill(3)?
Thanks!
-Garrett
_______________________________________________
freebsd-hackers@xxxxxxxxxxx mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@xxxxxxxxxxx"
- Follow-Ups:
- Re: pthreads : questions about concurrency and lifetime
- From: Pieter de Goeje
- Re: pthreads : questions about concurrency and lifetime
- Prev by Date: Re: Single UDP sockets : duplex capable?
- Next by Date: Re: pthreads : questions about concurrency and lifetime
- Previous by thread: Single UDP sockets : duplex capable?
- Next by thread: Re: pthreads : questions about concurrency and lifetime
- Index(es):
Relevant Pages
|