Processor Synchronization
Shared memory updates must be synchronized among processors
- Use memory locations as ‘locks’ to synchronize operations
One way to do this is the test-and-set instruction
- First test the value of a memory location
- If ZERO, then the lock is free, set the memory location to ‘1’ indicating that the lock has been grabbed
- The Read followed by Write must be ATOMIC - can’t allow another processor to access the lock between the read/write operations. TWO bus transactions.
While processor is waiting (spinning) on the lock, it is idle.