Complete the code to identify the classic problem where producers add items and consumers remove items from a shared buffer.
The classic problem where producers and consumers share a buffer is called the [1] problem.
The Producer-Consumer problem involves producers generating data and placing it into a buffer, while consumers take data from the buffer. Synchronization is needed to avoid conflicts.
Complete the sentence to describe the main challenge in the Readers-Writers problem.
The main challenge in the Readers-Writers problem is to allow multiple readers to access the data simultaneously while ensuring that [1] have exclusive access.
In the Readers-Writers problem, multiple readers can read the data at the same time, but writers must have exclusive access to prevent data inconsistency.
Fix the error in the description of the Dining Philosophers problem.
In the Dining Philosophers problem, philosophers alternate between thinking and eating, but they must pick up [1] forks to eat.
Each philosopher needs two forks (one on each side) to eat, which can cause deadlock if all pick up one fork simultaneously.
Fill both blanks to complete the synchronization requirement in the Producer-Consumer problem.
A producer must wait if the buffer is [1], and a consumer must wait if the buffer is [2].
Producers wait when the buffer is full to avoid overflow, and consumers wait when the buffer is empty to avoid underflow.
Fill all three blanks to complete the description of the Readers-Writers problem constraints.
Multiple [1] can read simultaneously, but [2] must have exclusive access, and no [3] can read while a writer is writing.
Readers can read at the same time, writers need exclusive access, and readers cannot read while a writer is writing to prevent data inconsistency.