The distracted dentist problem: imagine a dentist office with asingle chair and a waiting room with a number of chairs in it. Whenthe dentist finishes an appointment, the dentist checks on a videomonitor if there are any patients in the waiting room. If thereare, one patient is invited to sit in the chair for an appointment.If there are no other patients waiting, the dentist sits in thechair and starts texting. When patients arrive, they look to seewhat the dentist is doing. If the dentist is texting, the customerrouses the dentist and sits in the chair for the appointment. Ifthe dentist is busy, the patient goes to the waiting room to find afree chair. If there is no free chair, the patient leaves theoffice. All the actions take an unknown amount of time. Thissituation can lead to problems. For example, a patient may find thedentist busy and proceed to the waiting room, but before thepatient gets a waiting room chair, the dentist might complete thecurrent appointment and upon seeing on the monitor no one issitting, decide to start texting. While the patient will eventuallysit down, the dentist won’t notice someone is waiting. It’s alsopossible that when the dentist is busy, there is one waiting roomchair available and two recently arrived patients might attempt tosit in the same chair. a) Provide a description of what semaphoresand system state you would define to create a deadlock freesolution b) Provide pseudo-code for the dentist c) Providepseudo-code for a patient
We are a professional writing service that provides original papers. Our products include academic papers of varying complexity and other personalized services, along with research materials for assistance purposes only. All the materials from our website should be used with proper references.