Classic Synchronization Problems Flashcards
What are the 3 classic synchronization problems?
- Producer-Consumer AKA bounded-buffers
- Readers-Writers
- Dining-Philosophers
The classic synchronization problems are ________ that can be used to model money ______ ________ problems
abstractions, resource, sharing
The classic synchronization problems can be used to _______ newly proposed synchronization problems
test
In the bounded-buffer problem, what do producers and consumers do, and where?
producers insert into a buffer, and consumers remove from buffer
In the bounded-buffer problem, it is possible to have _________ producers and consumers
multiple
In the bounded-buffer problem, what are 3 issues?
- Violation of buffer structure
- Producing when full
- Consuming when empty
In the bounded-buffer problem, the solution uses ______ semaphores
three
In the bounded-buffer problem, what are the 3 semaphores used in the solution called, and what are they initialized to?
- mutex: 1
- full: 0
- empty: N
In the bounded-buffer problem, the producer ________ full and _________ empty
increments, decrements
In the bounded-buffer problem, there is a _______ between producers and consumers
symmetry
In the readers-writers problem, _____ is shared among multiple processes
data
In the readers-writers problem, readers only _____ and do not perform any ________
read, updates
In the readers-writers problem, writers can _____ and ________
read, write
In the readers-writers problem, what are the 2 requirements for a solution?
- Allow multiple concurrent readers and no writer
- Allow one writer and no reader
In the readers-writers problem, a solution as provided by the OS and runtime libraries called __________ in Pthread
pthread_rw_lock*