Professional Documents
Culture Documents
2.1.5. POSIX Threads: BITS Pilani
2.1.5. POSIX Threads: BITS Pilani
2.1.5. POSIX Threads: BITS Pilani
Linux Processes.
In this segment
BITS Pilani
The moment the main thread terminates, the child thread will also terminate.
Steps to make the child thread joinable
BITS Pilani
When a thread is created, one of its attributes defines whether it is joinable or
detached.
The attr argument in the pthread_create() routine, indicates whether the thread
going to be created is joinable or not.
Only threads that are created as joinable can be joined.
If a thread is created as detached, it can never be joined.