1 / 12

CS533 Concepts of Operating Systems Class 3

Explore the role of monitors in addressing concurrent programming problems, deadlock, synchronization, queuing discipline, and more. Learn about Mesa, Hoare's semantics, I/O handling, and process creation within monitors.

bthibodeau
Download Presentation

CS533 Concepts of Operating Systems Class 3

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. CS533 Concepts of Operating SystemsClass 3 Monitors

  2. Questions • Which concurrent programming problems do monitors address? • Are monitors useful as a programming convention, i.e., without compiler support? • What is the convention? • With compiler support for monitors, what are the important tasks of the compiler? • Why does encapsulation help with synchronization? CS533 - Concepts of Operating Systems

  3. Questions • Do monitors solve the deadlock problem? • How might the queuing discipline for waiting processes avoid starvation? • Why do we need condition variables instead of a single waiting queue per monitor? • Does a condition variable have a value (such as true/false)? CS533 - Concepts of Operating Systems

  4. Questions • What are the implications of allowing monitor calls to make calls to different monitors? • Should the monitor lock be released before such a call? • Which kinds of monitor procedures do not need to acquire/release the monitor lock, and why? CS533 - Concepts of Operating Systems

  5. Questions • How does non-preemptive scheduling solve concurrency problems? • What problem does it have on multiprocessors? • What problem does I/O present? • Why are page faults a problem for this approach? • How can mutual exclusion in a monitor be enforced? • … on uniprocessors and multiprocessors? CS533 - Concepts of Operating Systems

  6. Questions • Mesa operates in an environment that doesn’t use hardware protection • How does this affect the cost of monitor operations? • How is processes creation in Mesa similar to thread creation in Pthreads? • Why join? • Why detatch? • Why might you still use p after calling Detach[p]? • What dangling reference problems can arise with process pointers? CS533 - Concepts of Operating Systems

  7. Questions • How is handling exceptions in root procedures of Mesa processes more complicated than in normal Mesa procedures? • What issues arise when an exception is generated within a monitor procedure? • What does UNWIND do in Mesa? CS533 - Concepts of Operating Systems

  8. Questions • What is the difference between Hoare’s semantics for wait/signal and Mesa’s wait/notify? • What invariants can be assumed in each case? • What implications does this have for code surrounding a wait call? • What is the advantage of Hoare’s semantics for wait/signal vs Mesa’s wait/notify? • Why do Hoare semantics require more context switches? CS533 - Concepts of Operating Systems

  9. Questions • What are the advantages of Mesa’s wait/notify semantics? • In what way does it enable the use of timeouts? • In what way does it encourage the use of broadcast? CS533 - Concepts of Operating Systems

  10. Questions • How might you use monitors for I/O • Can interrupts be treated as signals? • What if no process was waiting? • How can devices make monitor calls? • If a device can’t wait on the monitor lock, how can it update monitor state? • What is a naked notify, and who is waiting on it? • Why is a wakeup-waiting switch needed with naked notifies? CS533 - Concepts of Operating Systems

  11. Questions • Why implement process creation as a monitor? • How is fork implemented? • How are join and end implemented? • Why is fork/join so expensive compared to other operations? CS533 - Concepts of Operating Systems

  12. Reminder • Please mail me your slides to put on the web page • The next paper is work in progress, presented by me CS533 - Concepts of Operating Systems

More Related