Volume 8 / Number 9 / September, 1965 | E. W. Dijkstra
This paper by E. W. Dijkstra addresses a problem in concurrent programming control, specifically the challenge of ensuring mutual exclusion among $N$ cyclic processes running on separate computers. The processes communicate via a common store, where writing or reading a word is an indivisible operation. The solution must be symmetrical, handle varying speeds of the computers, prevent potential blocking, and avoid infinite "After you" blocking.
The solution involves a common store with a Boolean array $b$ and an integer array $c[1:N]$, along with an integer $k$. Initially, all Boolean arrays are set to true, and $k$ is any value between 1 and $N$. Each computer's program includes a loop that checks if $k$ is not its own index, updates $c[i]$ to true, and increments $k$ if $b[k]$ is true. If $k$ is its own index, it sets $c[i]$ to false and checks if any other computer's $c[j]$ is true. If so, it increments $k$ and continues the loop. If no other computer's $c[j]$ is true, it enters its critical section, sets $c[i]$ and $b[i]$ to true, and then returns to the beginning of the loop.
The proof demonstrates that the solution ensures no two computers can enter their critical sections simultaneously and that no infinite "After you" blocking can occur. The key points are that the loop ensures that at least one computer will eventually enter its critical section, and once $k$ points to a looping computer, it will wait until all other computers have completed their critical sections.This paper by E. W. Dijkstra addresses a problem in concurrent programming control, specifically the challenge of ensuring mutual exclusion among $N$ cyclic processes running on separate computers. The processes communicate via a common store, where writing or reading a word is an indivisible operation. The solution must be symmetrical, handle varying speeds of the computers, prevent potential blocking, and avoid infinite "After you" blocking.
The solution involves a common store with a Boolean array $b$ and an integer array $c[1:N]$, along with an integer $k$. Initially, all Boolean arrays are set to true, and $k$ is any value between 1 and $N$. Each computer's program includes a loop that checks if $k$ is not its own index, updates $c[i]$ to true, and increments $k$ if $b[k]$ is true. If $k$ is its own index, it sets $c[i]$ to false and checks if any other computer's $c[j]$ is true. If so, it increments $k$ and continues the loop. If no other computer's $c[j]$ is true, it enters its critical section, sets $c[i]$ and $b[i]$ to true, and then returns to the beginning of the loop.
The proof demonstrates that the solution ensures no two computers can enter their critical sections simultaneously and that no infinite "After you" blocking can occur. The key points are that the loop ensures that at least one computer will eventually enter its critical section, and once $k$ points to a looping computer, it will wait until all other computers have completed their critical sections.