subject

Considering a new policy whereby the same bathroom may be used by both men and women. However, at any given time either only women or only men may be using the bathroom. Assume the bathroom has infinite capacity, write these functions: Woman_wants_to_enter
Man_wants_to_enter
Woman_leaves
Man_leaves
Your solution must satisfy the desired invariant stated above and be deadlock-free. It is acceptable for your solution to starve someone. You may use any combination of mutex locks, condition variable, and semaphores. You will get 0 points if your solution makes someone wait when they need not. You may use pseudo-code similar to that used in class; you do not need to use exact data type and function names from the pthreads API. You will win/lose points based on the following components/properties of your solution:
• Choice of synchronization-related variables, how you initialize them, and a succinct comment next to each describing its purpose
• Your use of synchronization-related variables with comments describing the purpose/effect of key statements and conditions .
• Your intent indicated in your comments must match what your pseudo-code accomplishes

ansver
Answers: 3

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 07:30, haleyblu6351
By refraining from constructing a building until they are certain that it will not cause harm to the environment, an organization is adhering to the
Answers: 2
image
Computers and Technology, 22.06.2019 12:40, Courtneymorris19
The most complicated four letter word
Answers: 1
image
Computers and Technology, 22.06.2019 12:50, michaelchavez6959127
You have just been hired as an information security engineer for a large, multi-international corporation. unfortunately, your company has suffered multiple security breaches that have threatened customers' trust in the fact that their confidential data and financial assets are private and secured. credit-card information was compromised by an attack that infiltrated the network through a vulnerable wireless connection within the organization. the other breach was an inside job where personal data was stolen because of weak access-control policies within the organization that allowed an unauthorized individual access to valuable data. your job is to develop a risk-management policy that addresses the two security breaches and how to mitigate these risks. requirementswrite a brief description of the case study. it requires two to three pages, based upon the apa style of writing. use transition words; a thesis statement; an introduction, body, and conclusion; and a reference page with at least two references. use a double-spaced, arial font, size 12.
Answers: 1
image
Computers and Technology, 22.06.2019 17:00, joshualoz5414
Acase study allows a more detailed look at the life of a single subject than any other study.
Answers: 3
You know the right answer?
Considering a new policy whereby the same bathroom may be used by both men and women. However, at an...

Questions in other subjects:

Konu
Mathematics, 30.11.2019 22:31