20. Hardware Assisted Synchronization Flashcards
1
Q
Atomicity
A
- If two or more simple operations are part of the same atomic block, the hardware will process those operations in one shot
2
Q
Spinlock
A
- A type of synchronization where one process will spin (loop) until it is able to acquire the lock
3
Q
sem.count
A
- The number of processes that can concurrently utilize the shared resource
- Decremented when a new process requests access
4
Q
sem.queue
A
- Contains references to the tasks blocked on the resource
5
Q
sem.wait
A
- Used by the process to check if it can access the resource (decrements sem.count by 1)
- The task is inserted into the waiting queue if sem.count <= 0
6
Q
sem.signal
A
- Used by the process to indicate that it is done using the shared resource (increments sem.count by 1)
7
Q
Uses of Semaphores
A
- Mutual exclusion: initialize sem.count = 1
- Controlled MPL: initialize sem.count = K
- Relative ordering of code: initialize sem.count to 0 and have the latter process wait for the former process to signal