You are on page 1of 1

POSIX Threads (pthreads)

========================

process thread
------- ------
fork -> pthread_create
wait -> pthread_join
exit -> pthread_exit (most often just "return")

A thread always executes a function. When he function is over, the


thread is over. You can have many hreads executing the same function.

The main function runs in a "main" thread. When the "main" thread is
over, all other threads (that are not detachable) stop as well,
regardless of whether they completed their work or not. So we need to
join the threads that we care to finish.

You might also like