CMSC 412

NOTE 5

Feb 27, 1999

N-Process Mutual Exclusion (also called Critical Section) Problem

1. Problem Definition

Given several concurrently executing processes, P0, P1, ..., PN-1, with each Pi executing a program of the following structure:
   while true do {
     NCS;  // non-critical section
     CS;   // critical section
   }
Come up with Entry and Exit code (that can depend on the process id) to place around each CS so that the program executed by process Pi is now
   while true do {
     NCS;  // non-critical section
     Entry(i);
     CS;   // critical section
     Exit(i);
   }
The system of processes should satisfy the following:

2. Comments