User Name Password Register
DaniWeb IT Discussion Community
All
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
Reply
Join Date: Nov 2007
Posts: 3
Reputation: dangerd is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
dangerd dangerd is offline Offline
Newbie Poster

Question Help

  #1  
Nov 3rd, 2007
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
Attached Files
File Type: h toilet.h (1.1 KB, 5 views)
File Type: c toilet.c (2.0 KB, 6 views)
File Type: h boys.h (143 Bytes, 3 views)
File Type: c boys.c (1.7 KB, 3 views)
File Type: h girls.h (148 Bytes, 3 views)
File Type: c girls.c (1.7 KB, 4 views)
File Type: h remover.h (169 Bytes, 3 views)
File Type: c remover.c (1.2 KB, 3 views)
File Type: h fairness.h (123 Bytes, 3 views)
File Type: c fairness.c (1.2 KB, 3 views)
File Type: h sleep.h (127 Bytes, 3 views)
File Type: c sleep.c (251 Bytes, 3 views)
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Aug 2005
Location: near St Louis, Missouri, USA
Posts: 11,541
Reputation: Ancient Dragon has much to be proud of Ancient Dragon has much to be proud of Ancient Dragon has much to be proud of Ancient Dragon has much to be proud of Ancient Dragon has much to be proud of Ancient Dragon has much to be proud of Ancient Dragon has much to be proud of Ancient Dragon has much to be proud of Ancient Dragon has much to be proud of Ancient Dragon has much to be proud of 
Rep Power: 40
Solved Threads: 972
Moderator
Featured Poster
Ancient Dragon's Avatar
Ancient Dragon Ancient Dragon is offline Offline
Most Valuable Poster

Re: Help

  #2  
Nov 3rd, 2007
>>I was wondeing if somebody could comment them to help me understand them better.
Comment it yourself and you will understand it even more.
<<Freelance Programmer>> << Hobby Site>>
Signature links for sale. PM me for details
Reply With Quote  
Join Date: Nov 2007
Posts: 1
Reputation: fuhaohowy is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
fuhaohowy fuhaohowy is offline Offline
Newbie Poster

Re: Help

  #3  
Nov 8th, 2007
r u DCU Student?
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

DaniWeb C Marketplace
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes

Other Threads in the C Forum

All times are GMT -4. The time now is 6:33 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC