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
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Spinlock

A
  • A type of synchronization where one process will spin (loop) until it is able to acquire the lock
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

sem.count

A
  • The number of processes that can concurrently utilize the shared resource
  • Decremented when a new process requests access
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

sem.queue

A
  • Contains references to the tasks blocked on the resource
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
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
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

sem.signal

A
  • Used by the process to indicate that it is done using the shared resource (increments sem.count by 1)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
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
How well did you know this?
1
Not at all
2
3
4
5
Perfectly