Chapter 5 - Process Synchronization Flashcards
What causes a race condition?
When several processes access and manipulate the same data concurrently
What determines the outcome of a race condition?
Which order each process access the data
What is the critical section of a process?
The part of the process’ code where it is manipulating data
How do you solve the critical section problem?
Each process must ask permission to enter critical section in entry section, follow critical section with exit section, and then execute the remainder section
Where is it especially difficult to solve critical section problem?
Preemptive kernels
What is an atomic instruction?
Non-interruptible instruction used on modern machines to avoid critical section problem
How do you solve the critical section problem with locks?
Acquire a lock, do critical section, release lock, do remainder section
What is Test-And-Set
Solution to critical section process using shared boolean variable lock, initialized to false
Other than the critical section problem, what are some process synchronization problems?
Bounded-Buffer Problem and Readers-Writers Problem