Concurrency synchronization Flashcards
1
Q
mutex
A
“mutual exclusion”
2
Q
what does mutex protect
A
shared resource or code that only one thread is able to execute at a time -> critical section
3
Q
what does every semaphore have
A
associated queue of tasks/threads
4
Q
atomicity
A
atomic integers, etc –> need uninterruptible actions to work properly
5
Q
what happens if there is not atomicity
A
race conditions
6
Q
the sequence of actions that happen in cpu to manipulate data structure of lock must happen
A
atomically (not being interrupted for access by another thread)
7
Q
thread safe
A
characteristic of block of code or data structure –> can be used concurrently by more than one thread without causing issues