This preview shows page 1. Sign up to view the full content.
Unformatted text preview: pthread_exit().
If main() returns or any thread calls exit()all
threads are terminated. Thread Examples
Complex thread arguments Detached State
Each thread can be either joinable or detached .
Detached: on termination all thread resources
are released by the OS. A detached thread
cannot be joined.
No way to get at the return value of the thread. (
a pointer to something: void * ). Joinable Thread
Joinable: on thread termination the thread ID
and exit status are saved by the OS.
One thread can "join" another by calling
pthread_join - which waits (blocks) until a
specified thread exits.
int pthread_join( pthread_t tid,
void **status); Thread Safe library functions
You have to be c...
View Full Document
This note was uploaded on 10/21/2011 for the course CSCI 4061 taught by Professor Tripathi during the Spring '08 term at Minnesota.
- Spring '08