High-level Synchronization Operating Systems High-level Synchronization 1) These notes are © Aiman Hanna. All copyrights reserved. For more information please e-mail to: Contact@AimanHanna.com. 2) These notes are also based on: Operating Systems, 3rd edition by Garry Nutts, published by Addison Wesley, ISBN-10: 0201773449 | ISBN-13: 9780201773446 . These notes still totally enforce all copyrights for Nutts/ Addison Wesley. For more information on these rights, please refer to the original publication of the book. 3) VERY IMPORTANT: These notes are neither complete nor sufficient to study for the course. They are merely given so that you can follow the covered subjects. You should NEVER depend solely on these notes for your study. Any use of these notes that results in violation of any of the copyrights indicated above is strictly prohibited. © Dr. Aiman Hanna Department of Computer Science Concordia University Montreal, Canada Data Communications & Computer Networking, by: Aiman Hanna
Semaphores - Practical Considerations Active and Passive V() Busy-wait of the P() operation Implementation of semaphores
Implementation of Semaphores Using Disable and Enable Interrupts Potential failures of such implementation Using Test & Set (TS) instruction
Implementation of Semaphores Using TS to implement binary semaphores Using TS to implement counting/general semaphores
High-level Synchronization Semaphores are powerful, but solutions can become very complex High-level synchronization could provide an alternative
High-level Synchronization Simultaneous P() (also referred to as AND synchronization) NOTE: Although Simultaneous P() is covered and example of usage was discussed in class, you can skip section 9.1 entirely including Simultaneous P()
Monitors A high-level synchronization tool that is capable of performing what a semaphore can perform, and vise versa Initial Design of monitors Failure of this design? Reasons?
Monitors New design of monitors using conditions What is a condition, how are they used, and what is their usage rules
Classical Synchronization Problems Solving the 2nd Reader-Writer problem (priority is given to the writers) using monitors and conditions
Where is this week coverage in the textbook? Chapter 8: The remaining parts of Sections 8.3 (including Figure 8.17 and Figure 8.25) Chapter 9: Section 9.2 (until page 349) Note: The rest of this section/chapter will be covered during the following week Skip: section 9.1