Chapter 6 Synchronization Flashcards
How can more than one reader enter the critical section or shared?
readCount++;
How does a writer prevent another writer from entering the critical section?
P(writeblock)
What is the critical section?
A collection of operations in which only one process may be executing at a given time.
What does Mutual Exclusion, Process and Bounded wait mean?
Mutual Exclusion - Only one process can be in the critical section at a time.
Process - When no process is in the critical section, there’s a process that may want to execute and enters the critical section to execute, it would not be postponed indefinitely.
Bounded wait - When a process wants to execute, other processes are given a certain amount of time to enter the critical section before.
In Peterson’s solution to the critical section, what’s the purpose of the variable flag?
To determine which process wants enter the critical section.
What is a busy wait?
A process waits and is busy repeatedly checking to see if the condition is true.
Define race condition
A situation where two or more processes access shared data concurrently and the outcome depends on the order of execution.
What are cooperating processes?
Processes that interact with one another indirectly by sharing a common object.
What is a semaphore?
An OS abstract type that allows one process to control the shared resource while the other process waits for the resource to be released.
What’s the difference between a Counting semaphore and Binary semaphore?
Counting semaphore – integer value can range over an unrestricted domain.
Binary semaphore – integer value can range only between 0 and 1; can be simpler to implement.
What is Starvation?
A process may never be removed from the semaphore queue in which it is suspended. (indefinite blocking)
What is Deadlock?
Two or more processes are waiting indefinitely for an event that can be caused by only one of the waiting processes.