0

I have a problem synchronizing processes using semaphores that are initialized at 1.

I have the following example: There are six processes. Process 1 can start any time. Process 2 must wait for process 1 to finish. Process 3 can start any time. Process 4 must wait for both process 2 and process 3 to finish. Process 5 must wait for process 4 to finish. Process 6 must wait for process 3 to finish.

The semaphores used, must be initialized at 1.

How can we avoid p2,p4,p5, and p6 executing first since all semaphores should be initialized at 1?

0 Answers0