strict N process synchronization using 2 semaphores
问题 a few years ago I had an Operating Systems seminar. I had been tasked to create an algorithm for process synchronization using as few semaphores as possible. It should have looked like this: P1 -> P2 -> P3 -> P4 -> P5 P(n) - process Only one process running at a time and strict ordering was needed . Last year I came with solution using 3 semaphores (effectively creating a barrier). Here is my algorithm: P S1 S1 S1 S1 4W1 W0 W0 W0 W0 4S0 P S2 S2 S2 3W2 W1 W1 W1 3S1 P S1 S1 2W1 W0 W0 2S0 P S2