Consider the thirsty person problem given below: To drink, a thirsty person must have three things; water, ice and a glass. There are three thirsty people, each having a different one (and only one) of the three required items. A fourth person, a server has unlimited supply of all three items. If nobody is drinking, the server places two of the three items (chosen at random) onto table. Thirsty person who can make a drink from those two items will pick them up and drink a glass of ice water. When done, thirsty person will notify the server and the process will repeat. Write a process that will control the thirsty person and the server using semaphores. (i) What is a critical section in code? Explain the three properties that any solution to the Critical Section Problem should guarantee. Explain the role the Operating System plays in Garbage-In-Garbage-Out (GIGO).
QUESTION THREE
Consider the thirsty person problem given below: To drink, a thirsty person must have three things; water, ice and a glass. There are three thirsty people, each having a different one (and only one) of the three required items. A fourth person, a server has unlimited supply of all three items. If nobody is drinking, the server places two of the three items (chosen at random) onto table. Thirsty person who can make a drink from those two items will pick them up and drink a glass of ice water. When done, thirsty person will notify the server and the process will repeat. Write a process that will control the thirsty person and the server using semaphores.
(i) What is a critical section in code?
Explain the three properties that any solution to the Critical Section Problem should guarantee.
Explain the role the
Trending now
This is a popular solution!
Step by step
Solved in 3 steps