Cinderella and the Prince are getting divorced. To divide their property, they have agreed on the following algorithm. Every morning, each one may send a letter to the other’s lawyer requesting one item of property. Since it takes a day for letters to be delivered, they have agreed that if both discover that they have requested the same item on the same day, the next day they will send a letter cancelling the request. Among their property is their dog, Woofer, Woofer’s doghouse, their canary, Tweeter, and Tweeter’s cage. The animals love their houses, so it has been agreed that any division of property separating an animal from its house is invalid, requiring the whole division to start over from scratch. Both Cinderella and the Prince desperately want Woofer. So that they can go on (separate) vacations, each spouse has programmed a personal computer to handle the negotiation. When they come back from vacation, the computers are still negotiating. Why? Is deadlock possible? Is starvation possible? Discuss your answer.
Note: please type your answer don't put picture or write by hand
Here is the situation that could have happened, both are still negotiating for woofer like an infinite loop
Morning 1st 2nd 3rd 4th 5th 6th . . . . |
Cinderella Request(woofer) cancelRequest Request(woofer) cancelRequest Request(woofer) cancelRequest . . . . |
Prince Request(woofer) cancelRequest Request(woofer) cancelRequest Request(woofer) cancelRequest . . . . |
Morning 1st 2nd 3rd 4th 5th 6th . . . . |
Cinderella Request(woofer) Request(woofer doghouse) . . . . . |
Prince Request(woofer doghouse) Request(woofer) . . . . . |
In such situation too, they will have to cancel and renegotiate and this process will go on.
You can see that they both want woofer desperately and repeatedly requesting an cancelling requests for the same. It's like an infinite loop.
Deadlock and starvation is not possible, because they have already agreed that if same item is requested they will cancel their requests and in case of separation of animals with their houses they will start afresh. But certainly it can go into an infinite loop.
Cinderella and the Prince are getting divorced. To divide their property, they have agreed on the...