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

Another question on Computers and Technology

question
Computers and Technology, 21.06.2019 23:00
The animal classthis class represents a an animal residing at a zoo. it has a weight (in pounds),height (in inches), a name, and a color. the methods in the class include constructors,getters, and a tostring. you will finish the implementation of these methods. referto the code documentation.1.getters: you will need to implement getter methods. these get a value (froma member variable) in the animal class. you will make a getter method toreturn each variable (weight, height, name, color). reference getname if youare having issues.2.tostring: you will need to finish the tostring method. this returns a stringcontaining information about an animal. the output string should be of theformat: ” (name) , a ( color )â’colored animal . ( weight ) pounds , ( height ) inches .\n”the height and weight are formatted to 1 decimal place. recall from lab 1how to format strings neatly using string. see the reference sectionfor more about string.format.
Answers: 2
question
Computers and Technology, 23.06.2019 02:50
There’s only one game mode that stars with the letter ‘e’ in cs: go. which of the options below is it?
Answers: 1
question
Computers and Technology, 24.06.2019 17:40
When analyzing data sets, such as data for human heights or for human weights, a common step is to adjust the data. this can be done by normalizing to values between 0 and 1, or throwing away outliers. for this program, adjust the values by subtracting the smallest value from all the values. the input begins with an integer indicating the number of integers that follow. ex: if the input is 5 30 50 10 70 65, the output is: 20 40 0 60 55
Answers: 1
question
Computers and Technology, 24.06.2019 23:30
Adrian has decided to subscribe for a new internet connection. he wants a high speed connection so that he can stream video content smoothly. which access technology would you advise adrian against using?
Answers: 1
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
question
Mathematics, 17.09.2021 09:30
question
Business, 17.09.2021 09:30
question
Chemistry, 17.09.2021 09:30
question
Mathematics, 17.09.2021 09:30
question
Geography, 17.09.2021 09:30
question
Mathematics, 17.09.2021 09:30
question
Mathematics, 17.09.2021 09:30
Questions on the website: 13722363