PThreads are
POSIX Threads
POSIX is
Portable Operating System Interface
Birrell Thread Creation
fork(proc, args)
PThread Attributes
stack size inheritance joinable scheduling policy priority system/process scope
Zombie Thread
Parent thread dies
Data race
(aka race condition) thread tries to read a value while another thread modifies it
Mutex Safety Tips
Shared data should always be accessed through a single mutex
Mutex scope must be visible to all
Globally order locks
Always unlock the correct mutex
Condition Variable Safety Tips
Do not forget to notify waiting threads
When in doubt, broadcast
Yo do not need a mutex to signal/broadcast (unlock mutex first)