Quote:

The amount of happiness that you have depends on the amount of freedom you have in your heart

Monday 26 December 2011

CS604 Operating Systems Assignment 3 Fall2011

Operating Systems (CS604)

Assignment # 3

Fall 2011

                                                           Total Marks: 20

Assignment Statement

A chief minister office is designed in such a way that there is a waiting room adjoining the minister’s office. Waiting room has two doors D1 and D2, D1 opens inside the minister’s room and D2 is used for entrance from out side. Waiting room has N chairs for some contractors who have to see chief minister. If the minister is busy, the door D1 is closed and arriving contractor sits in one of the available chairs. If a contractor enters the waiting room and all chairs are occupied, the contractor leaves the office without meeting. If there are no contractors in the waiting room, the minister goes to rest (sleep) in the chair with the door D1 open. If minister is asleep, the contractor makes the minister awake by ringing the bell and gets meeting with him.
While keeping in mind the given scenario, you have to write the pseudo code OR code fragment using semaphores to define synchronization scheme for the contractor and chief minister.

No comments:

Post a Comment

“You can't change the past, but you can ruin the present by worrying about the future”