ICP Flashcards
What is a Critical Region?
Where processes access shared variables.
What are the four criteria for a critical region routine.
- Mutual exclusion (One at a time)
- Speed Independent
- Non-Critical Regions Immaterial
- Finite Waiting
What are the instructions that all process go through?
- Read
- Modify
- Write.
describe spin lock
Spin lock is busy waiting on a lock polling.
What is Peterson’s Algorithm?
Combines turn taking and “Interested” flags.
What are the steps in Peterson’s Algorithm?
- Raises flag when interested in entering critical region.
- Gives turn to other process.
- Checks whether the other process is interested AND it is the other process’ turn, to wait or enter region.
- When exiting region, lower flag.
What is the Test & Set lock (TSL)?
When the process instructions are atomic.
What is the meaning of atomic?
Cannot be divided.
What IPC mechanism keeps track of the number of available recourses in a count variable?
Semaphore
What is considered a binary semaphore, and can only have 0 or 1 as values?
Mutex
What are the condition variables for monitors?
- Wait
- Signal
What can be true about Readers and Writers?
- Multiple readers can co-exist
- Multiple writers cannot co-exist
- Writers and readers cannot co-exist
Reader Priority is when ….
Readers are not kept waiting until a writer gets permission. (Starves writers)
Writer Priority is when ….
Readers cannot access if writer is waiting (starves readers)
Describe no starvation solution (Mutex solution)
Writers lock the region
-if writer is writing, all incoming readers wait, all go in when writer is done.