amkahal
Hi guys,
Please can someone help solving this "Operating Systems" exercise:
Concurrent processes P1, P2 et P3 execute each the following program:
Pi () /* i = 1, 2, 3 */
{
int n=0;
while(true)
printf(“cycle %d of %d“, n++, i);
}
– Synchronize the cycles between the processes (using semaphores) in such a way: Each cycle of P1 can execute in concurrence with a cycle of P2. Process P3 executes a cycle, when both P1 and P2 terminate the execution of a cycle. When P3 terminates a cycle, both P1 and P2 can launch a new cycle and so on …. Hints: you will need to write three codes (one code per process).
note: i want to solve it before Tomorrow midnight, because i want to send to my instructor, thanks in advance.