Chapter 8 Flashcards
(20 cards)
What’s the point of chapter 8?
- Processes can execute at the same time. Concurrent access to shared data may result in data inconsistency
What’s the purpose of a counter?
A counter will keep track of the full buffers
- It is set to 0
- Producer will increment it when producing a new buffer
- Consumer will decrement it after it consumes the buffer
What is a Critical Section?
- Each process has a critical section segment of code
- Process will change common variables, update the file etc.
- Only one process can be in it’s critical section at a time
What is the Critical Section Problem?
- A design protocol to solve the issue
- Each process must first ask permission in the entry section, will then go to the exit section followed by the remainder section
What is Mutual exclusion ( The first step in the Critical selection problem)
- Only one process can be executing in their critical selection at a time
What is Progress ( The second step in the critical Selection problem)
-If no one process is executing in it’s critical section and another process wants to move on to the critical section then it can’t be postponed.
What is Bounded Waiting ( The third step in the critical Selection problem)
- A limit must exist on the number of times that other processes are allowed to enter their critical sections after a process has made that request
What is a Preemptive kernel?
- Allows preemption of the kernel when running in kernel mode
What is a Non - Preemptive kernel?
- Runs until it exits kernel mode. Blocks or voluntarily yields CPU
What is Peterson’s solution?
- Introduces two variables
int turn; - Indicates whose turn it is to enter the critical section
Boolean flag [2] - Is an array that stores all the processes ready to enter the critical section
What is the main theme of hardware solutions to solve the issue.
- Hardware solutions are based on the idea of locking or protecting critical regions via lock
How do Uniprocessors try to solve the issue?
- Can disable interrupts which isnt viable on multiprocessor systems
What are some Software solutions?
- Simplest is a mutex lock
- Protects critical section by first acquiring and then releasing the lock
- Calls to do this must be atomic or non- interruptable
What is a semaphore?
- A synchronization tool that provides more ways for a process to synchronize their activities
What is the difference between a counting semaphore and a Binary Semaphore.
- Counting Semaphore can be set to any value
- Binary semaphore can only be set to 1 or 0
What is a block?
- Places the process invoking the operation on the appropriate waiting queue
What is Wakeup?
- Removes one of the processes in the waiting queue and places it in the ready queue
What’s a deadlock?
- Two or more processes waiting indefinitely for an event that can be caused by only one of the waiting processes
What is Starvation?
- A process may never be removed from the semaphore queue in which its suspended
What is Priority Inversion?
- A scheduling problem when lower priority process holds a lock needed by a higher priority process.
- solved via priority Inheritance protocol