P2L3 Flashcards
1
Q
PThreads are
A
POSIX Threads
2
Q
POSIX is
A
Portable Operating System Interface
3
Q
Birrell Thread Creation
A
fork(proc, args)
4
Q
PThread Attributes
A
stack size inheritance joinable scheduling policy priority system/process scope
5
Q
Zombie Thread
A
Parent thread dies
6
Q
Data race
A
(aka race condition) thread tries to read a value while another thread modifies it
7
Q
Mutex Safety Tips
A
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
8
Q
Condition Variable Safety Tips
A
Do not forget to notify waiting threads
When in doubt, broadcast
Yo do not need a mutex to signal/broadcast (unlock mutex first)