shared: bool flag[] = { false, false }; // Do I want to be in the C.S. Process 0 | Process 1 -------------------------+-------------------------- flag[0] = true; | flag[1] = true; while (flag[1]) | while (flag[0]) pause(); | pause(); C.S. | C.S. flag[0] = false; | flag[1] = false; |