Table of Contents
Lecture Topics: 11/8
A Quick Motivating Example
Queue Example
Disaster Strikes
Unsynchronized Data Access
Characterizing the Problem
Atomic Operations
Read/Modify/Write Not Atomic
Counter Example
Two Kinds of Code
Critical Sections
Critical Section Solutions
Implementing Synchronization
Turning off Interrupts
Problems with Disabling Interrupts
Spinlocks
Entry and Exit Using Spinlocks
What’s Wrong with Spinlocks?
Semaphores
How Semaphores Work
Semaphores vs. Spinlocks
Semaphores version 2
Building up to Semaphores
The Dining Philosophers
For the Visual Learners...
Implementing the Philosophers
Trying Again
Deadlock
Starvation
Who Cares About Philosophers?
Readers and Writers
Implementing Readers and Writers
Semaphore Conclusions
Monitors
Entry Procedures
Conditions
Dining Philosopher Monitor
Monitor Conclusions
|