tac0S
Template Affectional Command Operating System
|
Data structures for synchronizing threads. More...
Data structures for synchronizing threads.
Any implementation of a synchronization routine needs some primitive atomic operation. We assume Nachos is running on a uniprocessor, and thus atomicity can be provided by turning off interrupts. While interrupts are disabled, no context switch can occur, and thus the current thread is guaranteed to hold the CPU throughout, until interrupts are reenabled.
Because some of these routines might be called with interrupts already disabled (Semaphore::V for one), instead of turning on interrupts at the end of the atomic operation, we always simply re-set the interrupt state back to its original value (whether that be disabled or enabled).
Copyright (c) 1992-1993 The Regents of the University of California. All rights reserved. See copyright.h for copyright notice and limitation of liability and disclaimer of warranty provisions.