PPT Slide
Implementation of Mutual Exclusion
- Two prior solutions to the mutex problem: use of Message Queues & that pesky ExchangeWord() (more on this later).
- 1st solution - disable interrupts while the process is in a critical section (no interrupts == no timer interrupt == no context switch to some other process). Book mentions it works well on a single-processor machine, but neglects the downside of having a user program running with interrupts disabled!
- 2nd solution - Use ExchangeWord(): a special hardware instruction that allows one processor to read and modify a word in memory without any other processor getting access (atomic read & modify).
-