Semaphore s1 = 1; Semaphore s2 = 1; Semaphore s3 = 1; Semaphore s4 = 1; Semaphore s5 = 1; par { phil(s1,s2); } { phil(s2,s3); } { phil(s3,s4); } { phil(s4,s5); } { phil(s5,s1); } phil(stickl, stickr) { while (true) { think(); P(stickl); if (lookup(stickr) == 0) { V(stickl) } else { P(stickr); eat(); V(stickl); V(stickr); } } }