Preemptive Scheduling and Mutex
Goal
-
Understand how to use interrupt disable and atomic read-modify-write to
implement mutual exclusion.
Reading Assignments
Discussion topics
-
The simplest way to implement Acquire()
and Release() is:
Acquire()
{
disable interrupts;
}
Release()
{
enable interrupts;
}
Do you think it works? If you think it works, say under what
condition it works. If do not think so, explain why it does not work
and how would you make it work.
-
The textbook mentioned about using test-and-set instruction to implement
mutual exclusion. How would you use it to implement Acquire()
and Release()?