11.12 R4000 Processor Synchronization Support

Counter


Another common synchronization technique uses a counter. A counter is a designated memory location that can be incremented or decremented.

In the test-and-set method, only one processor at a time is permitted to enter the critical section. Using a counter, up to N processors are allowed to concurrently execute the critical section. All processors after the Nth processor must wait until one of the N processors exits the critical section and a space becomes available.

The counter works by not allowing more than one processor to modify it at any given time. Conceptually, the counter can be viewed as a variable that counts the number of limited resources (for example, the number of processes, or software licenses, etc.). Figure 11-17 shows this process.



Figure 11-17 Synchronization Using a Counter



Copyright 1996, MIPS Technologies, Inc. -- 21 MAR 96

Generated with CERN WebMaker
statistics