Highlevel Synchronization Prof Aiman Hanna Department of Computer

  • Slides: 10
Download presentation
High-level Synchronization © Prof. Aiman Hanna Department of Computer Science Concordia University Montreal, Canada

High-level Synchronization © Prof. Aiman Hanna Department of Computer Science Concordia University Montreal, Canada

Semaphores - Practical Considerations l Active and Passive V() l Busy-wait of the P()

Semaphores - Practical Considerations l Active and Passive V() l Busy-wait of the P() operation l Implementation of semaphores 2

Implementation of Semaphores l Using Disable and Enable Interrupts l Potential failures of such

Implementation of Semaphores l Using Disable and Enable Interrupts l Potential failures of such implementation l Using Test & Set (TS) instruction 3

Implementation of Semaphores l Using TS to implement binary semaphores l Using TS to

Implementation of Semaphores l Using TS to implement binary semaphores l Using TS to implement counting/general semaphores 4

High-level Synchronization l Semaphores are powerful, but solutions can become very complex l High-level

High-level Synchronization l Semaphores are powerful, but solutions can become very complex l High-level synchronization could provide an alternative 5

High-level Synchronization l Simultaneous P() (also referred to as AND synchronization) l NOTE: Although

High-level Synchronization l Simultaneous P() (also referred to as AND synchronization) l NOTE: Although Simultaneous P() is covered and example of usage was discussed in class, you can skip section 9. 1 entirely including Simultaneous P() 6

Monitors l A high-level synchronization tool that is capable of performing what a semaphore

Monitors l A high-level synchronization tool that is capable of performing what a semaphore can perform, and vise versa l Initial Design of monitors l Failure of this design? Reasons? 7

Monitors l New design of monitors using conditions l What is a condition, how

Monitors l New design of monitors using conditions l What is a condition, how are they used, and what is their usage rules 8

Classical Synchronization Problems l Solving the 2 nd Reader-Writer problem (priority is given to

Classical Synchronization Problems l Solving the 2 nd Reader-Writer problem (priority is given to the writers) using monitors and conditions 9

Where is this week coverage in the textbook? l Chapter 8: l The remaining

Where is this week coverage in the textbook? l Chapter 8: l The remaining parts of Sections 8. 3 (including Figure 8. 17 and Figure 8. 25) l Chapter 9: l Section 9. 2 (until page 349) Note: The rest of this section/chapter will be covered during the following week Skip: section 9. 1 10