Chapter 22 Flashcards
What are semaphorse in operating system solutions
semaphorse is a synchronization tool. It is available in operating system. It is an integer variable that can only be accessed via two indivisible (atomic) operations, called wait and signal. example of a white road block in traffic signal. A car or a bus can cross it at a time.
What are 2 operations used by semaphorse
- Wait
2. Signal
What wait operation do in semaphorse
It keeps waiting and wait for value of semaphorse that is less than equal to 0 to increase.
What are 2 types of atomic execution
- Uni-processor environment
2. Bus-based multi-process environment
What is Uni-processor environment
We inhibit interrupts before executing code of wait() and signal()
What is bus-based multi-processor environment
we use software solution in it (e.g. bakery algorithm). we lock the data bus
What is busy waiting
processes keep waiting and in loop. Its a wastage of CPU resources.
What are 2 simple operations in semaphore implementation
- block() suspends the process that invoke it
2. wakeup() resume the execution of blocked process
What is the meaning of negative value of a semaphore
The negative value of s value indicates the number of processes waiting for semaphore.
How to stop busy waiting
We put semaphore queue so process spinning in a loop should be waiting in a queue.
What is atomic operation
An operation that performs interrupted. e.g. 2 atomic operations can not take place at the same time on a semaphorse.