I am taking a course in Operating Systems. I am going through old exams and there is a question about monitors. We are supposed to give a solution for the producer-consumer problem using monitors. That is quite clear. But, it also says in the question:

List also the assumptions that you make about monitor semantics

Can anyone explain what is meant by this?

  • $\begingroup$ Consider what the monitor pattern is, and that producer and consumer are asynchronous processes. Shared data structures require synchronization to ensure that each views the shared data in a consistent state and leaves it in a consistent after it makes any changes. $\endgroup$ – Zenilogix Oct 20 '19 at 18:18
  • $\begingroup$ could you please elaborate a little bit? isn't what you are saying the very essence of monitors? to my understanding, that's exactly what a monitor does - only allows one process at a time in the critical section. $\endgroup$ – Jan Pisl Oct 20 '19 at 18:46
  • $\begingroup$ How about asking your instructor? $\endgroup$ – Yuval Filmus Oct 27 '19 at 11:06
  • $\begingroup$ perhaps i asked and didn't get a response. or i got a response that didn't cleared it up for me. or I don't want to ask him for one reason or another. there can be many reasons. it is totally irrelevant to the question. if you feel this is not a good question, downvote it or vote to close it. i never understand why people bother writing unfriendly and useless comments like yours. $\endgroup$ – Jan Pisl Oct 27 '19 at 15:35
  • $\begingroup$ One way to interpret the comment might be: we encourage people to do research to try to figure out the answer on their own before asking, and show us in the question what research they've done. How much research? A lot. What kind of research could you do? One thing you could do is ask your instructor. (Rather than telling us what perhaps you might have done, I suggest you tell us what you actually did do.) Another thing is you could check standard textbooks and Wikipedia to see if there are multiple kinds of monitors. $\endgroup$ – D.W. Oct 28 '19 at 5:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.