Question 1

Which style of monitor directly transfers the control from the thread invoking signal() to the waken thread?

Choices: Mesa style, Hoare style

Question 2

If wait(&lock) is invoked after signal(&lock) is invoked, the wait call will...

Choices: wait, continue

Question 3

A factory is producing socks. Use lock(s) and condition variable(s) to write a procedure ASockIsProduced(), which called whenever a sock (thread) is produced. As soon as two socks are available, one thread should call PickAPair() (you don't need to implement PackAPair()), and two threads should return from ASockIsProduced().

Question 4

A factory is producing pepper and salt shakers. Use lock(s) and condition variable(s) to write a procedure PepperShakerArrives() that is called whenever a pepper shaker (thread) is produced. Use lock(s) and condition variable(s) to write another procedure SaltShakerArrives() that is called whenever a salt shaker (thread) is produced. As soon as one pepper shaker and one salt shaker are available, one of the threads should call PackShakers() (you don't need to implement PackShakers()); one thread is returned from PepperShakerArrives() and one thread is returned from SaltShakerArrives().

Question 5

Do we have a deadlock if all four deadlock conditions are met?

Choices: No, Yes

Academic Honesty!
It is not our intention to break the school's academic policy. Posted solutions are meant to be used as a reference and should not be submitted as is. We are not held liable for any misuse of the solutions. Please see the frequently asked questions page for further questions and inquiries.
Kindly complete the form. Please provide a valid email address and we will get back to you within 24 hours. Payment is through PayPal, Buy me a Coffee or Cryptocurrency. We are a nonprofit organization however we need funds to keep this organization operating and to be able to complete our research and development projects.