The Dining Philosophers (cont.)
Array [1..5] of semaphores : fork = [1, 1, 1, 1, 1 ];
wait( table ); wait( fork[i] );
wait( fork[ (i+1) mod 5 );
signal( fork[ (i+1) mod 5 );
signal( fork[i] ); signal( table );
Allow only 4 of them to come to the table at the same time