MDAT  1.0
 All Classes Files Functions Variables Typedefs Pages
Implementing Unisex Restroom with MDAT

In this problem, there is a single restroom that can be used by both men and women but not at the same time. There is no limit to how many people can be in the restroom at once but they all have to be the same gender. There are two versions of this problem: (a) The initial version as described above. (b) Same as the initial version with the added restriction of having at most four people in the restroom at once.

The implementation is identical to that of the readers-writers problem except for the following differences:

  • There are two sections files: sectionsA.c for part a (initial version) and sectionsB.c for part b (restricted version)
  • The Makefile will create two executables mdatA and mdatB for parts a and b respectively.
  • The checker is altered to reflect the mutual exclusion rules of this problem. Conditional compilation is used such that the added restriction of having at most four people in the restroom at once is only present when creating mdatB.
  • The automation script run-mdat.py has an extra required parameter -m a-or-b that indicates whether mdatA or mdatB should be run.
This is a personal WEB site developed and maintained by an individual and not by Seattle University. The content and link(s) provided on this site do not represent or reflect the view(s) of Seattle University. The individual who authored this site is solely responsible for the site's content. This site and its author are subject to applicable University policies including the Computer Acceptable Use Policy (www.seattleu.edu/policies).