chapter 6 synchronization Flashcards
if
Two or more processes/threads manipulate a shared resource
concurrently, and
The outcome of the execution depends on the particular order
in which the access takes place
it it is called racecondition
____________ is needed to prevent race conditions from happening
Synchronization
To avoid race conditions, the execution of critical section must be
mutually exclusive
The _____________ is to design a protocol with which processes can use to cooperate and ensure mutual exclusion
critical-section problem
A __________ is a section of code in which a process accesses shared resources
critical section (CS)
A critical section protocol consists of two parts
entry section
exit section
A good solution to the critical section problem must satisfy the following three conditions
Mutual Exclusion
Progress
Bounded Waiting
If a process P is executing in its critical section, no other processes can be executing in their corresponding critical sections
this condition is called mutual exclusion
If a process P is executing in its critical section, no other processes can be executing in their corresponding critical sections (it should not block other process from accessing the cs).
Progress
After a process made a request to enter its critical section and before it is granted the permission to enter, there exists a bound on the number of turns that other processes are allowed to enter
bounded waiting
________ – allows preemption of the process when running in kernel mode
Preemptive
__________ – runs until exits kernel mode, blocks, or voluntarily yields CPU
Non-preemptive