Shared Variables

Critical Regions
1961 views
Critical Regions

How do we avoid race conditions? The key to preventing trouble here and in many other situations involving shared memory, shared files, and shared everything else is to find some way to forbid more than one process from reading and writing the shared data at the same time.

Peterson's Solution
2800 views
Peterson's Solution

By combining the idea of taking turns with the idea of lock variables and warning variables, a Dutch mathematician, T. Dekker, was the first one to plan a software solution to the mutual exclusion problem that does not require strict alternation. For a discussion of Dekker's algorithm, see (Dijkstra,

Page 0 of 1 Previous 1 Next