0
0
Operating Systemsknowledge~10 mins

Classic problems (producer-consumer, readers-writers, dining philosophers) in Operating Systems - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to identify the classic problem where producers add items and consumers remove items from a shared buffer.

Operating Systems
The classic problem where producers and consumers share a buffer is called the [1] problem.
Drag options to blanks, or click blank then click option'
ADining Philosophers
BReaders-Writers
CProducer-Consumer
DSleeping Barber
Attempts:
3 left
💡 Hint
Common Mistakes
Confusing the Producer-Consumer problem with the Dining Philosophers problem.
Choosing Readers-Writers which deals with access to shared data but not buffer sharing.
2fill in blank
medium

Complete the sentence to describe the main challenge in the Readers-Writers problem.

Operating Systems
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.
Drag options to blanks, or click blank then click option'
Awriters
Bconsumers
Cproducers
Dreaders
Attempts:
3 left
💡 Hint
Common Mistakes
Selecting readers instead of writers for exclusive access.
Confusing producers and consumers with readers and writers.
3fill in blank
hard

Fix the error in the description of the Dining Philosophers problem.

Operating Systems
In the Dining Philosophers problem, philosophers alternate between thinking and eating, but they must pick up [1] forks to eat.
Drag options to blanks, or click blank then click option'
Atwo
Bthree
Cone
Dfour
Attempts:
3 left
💡 Hint
Common Mistakes
Choosing one fork, which is insufficient to eat.
Choosing more than two forks, which is incorrect.
4fill in blank
hard

Fill both blanks to complete the synchronization requirement in the Producer-Consumer problem.

Operating Systems
A producer must wait if the buffer is [1], and a consumer must wait if the buffer is [2].
Drag options to blanks, or click blank then click option'
Afull
Bempty
Clocked
Dunlocked
Attempts:
3 left
💡 Hint
Common Mistakes
Mixing up full and empty conditions.
Using locked/unlocked which are not the main buffer states.
5fill in blank
hard

Fill all three blanks to complete the description of the Readers-Writers problem constraints.

Operating Systems
Multiple [1] can read simultaneously, but [2] must have exclusive access, and no [3] can read while a writer is writing.
Drag options to blanks, or click blank then click option'
Areaders
Bwriters
Dproducers
Attempts:
3 left
💡 Hint
Common Mistakes
Confusing readers and writers roles.
Including producers which are unrelated to this problem.