•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the C section within the Software Development category of DaniWeb, a massive community of 456,586 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 3,624 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our C advertiser: Programming Forums
Views: 381 | Replies: 2
![]() |
•
•
Join Date: Nov 2007
Posts: 3
Reputation:
Rep Power: 0
Solved Threads: 0
I have a systems programming problem. Its a group of small programs that interact with each other to implement a mutual exclusion problem. I was wondeing if somebody could comment them to help me understand them better. Would be very much appreciated.
They are toilets shared by boys and girls. However, at any time only boys or only girls may be in the toilets. (Mary runs a strict establishment and does not want any funny business going on in her toilets.) Mary's rules on using the toilets are simple. A boy can enter iff:
The toilets are empty or
The toilets are occupied by boys and a toilet is available
A girl can enter iff:
The toilets are empty or
The toilets are occupied by girls and a toilet is available
However, there is a caveat. In the interest of fairness, if one sex has been waiting a long time while the other hogs the toilets then a bouncer must intervene. The bouncer allows no one to enter until the toilets have emptied. He then allows the waiting sex to enter.
instead of bouncer she employs this software
They are toilets shared by boys and girls. However, at any time only boys or only girls may be in the toilets. (Mary runs a strict establishment and does not want any funny business going on in her toilets.) Mary's rules on using the toilets are simple. A boy can enter iff:
The toilets are empty or
The toilets are occupied by boys and a toilet is available
A girl can enter iff:
The toilets are empty or
The toilets are occupied by girls and a toilet is available
However, there is a caveat. In the interest of fairness, if one sex has been waiting a long time while the other hogs the toilets then a bouncer must intervene. The bouncer allows no one to enter until the toilets have emptied. He then allows the waiting sex to enter.
instead of bouncer she employs this software
•
•
Join Date: Aug 2005
Location: near St Louis, Missouri, USA
Posts: 11,541
Reputation:
Rep Power: 40
Solved Threads: 972
>>I was wondeing if somebody could comment them to help me understand them better.
Comment it yourself and you will understand it even more.
Comment it yourself and you will understand it even more.
![]() |
•
•
•
•
•
•
•
•
DaniWeb C Marketplace
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
Other Threads in the C Forum
- Previous Thread: problem in printing Hexadecimal no's
- Next Thread: How......



Linear Mode