Question: There are three cooperating processes. They all read data from the same input device. Each process, when it gets the input device, must read two
There are three cooperating processes. They all read data from the same input device. Each process, when it gets the input device, must read two consecutive data, only one process may access the input device at a time (Hint: use mutual exclusion to achieve it). Use semaphores to synchronize. Include declaration and initialization
P1: input (x1, x2)
C = y1 + x2 +z1
Print A
Print D
P2: input (y1, y2)
B = x1 + z2 + A
D = B + C
P3: input (z1, z2)
A = y2 + z1 + C
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
