process Flashcards
(14 cards)
What’s Mutual Exclusion?
If process P1 is executing in its critical section then no other processes can be executing in their critical sections
Progress?
If no processes are in their critical section and other processes wish to enter their critical section then the processes that are queued to enter can not be postponed
What is Bounded Waiting?
A bound must exist on the number of times that other processes are allowed to enter their critical sections after a process has made a request to enter its critical section before that request is granted.
What is Preemptive?
Allows preemption of process when running in kernel mode
What is Non Preemptive?
Runs until exits kernel mode, blocks or voluntarily yields CPU. Essentially free of race conditions in kernel mode
What is Bounded Buffer Problem?
- Buffers can only hold one item each
- semaphore mutex initialized to 1
- semaphore full intialized to 0
- semaphore empty initialized to the value n
What is the Readers Writers Problem?
- A data set is shared among a number of concurrent processes
- Readers: can only read that data set. they dont perform any updates
- Writers: Can bot read and write
Problem: Allow multiple readers to read at the same time. Only one single writer can access the shared data at the same time
Variations?
- First Variation: No reader kept waiting unless writer has permission to use shared object
- Second Variation: Once writer is ready, it performs the write asap
- Both may have starvation leading to even more variations
- Problem is solved on some systems by kernel providing reader writer locks
What is a Counting Semaphore?
- Integer value can range over an unrestricted domain
What is a Binary Semaphore?
- Integer value can range between only 0 and 1. same as a mutex lock
Semaphore Implementation with no busy waiting
- Block : place the process invoking the operation on the appropriate waiting queue
- Wakeup: remove one of the processes in the waiting queue and place it in the ready queue
What is a deadlock?
Two or more processes are waiting indefinitely for an event that can be caused by only one of the waiting processes
Starvation - Indefinite blocking
- A process may never be removed from the semaphore queue when it is suspended
Priority Inversion
- Scheduling problem when lower- priority process holds a lock needed by higher priority process
- Solved via priority inheritance protocall