We discussed the following problem in the class. X is a shar…
We discussed the following problem in the class. X is a shared variable between process A and process B. Process B can only retrieves x AFTER process A updates x. PAPB_S22.JPG Please use a monitor and a conditional variable to solve this problem.
Read DetailsIs the following solution correct to solve the critical sect…
Is the following solution correct to solve the critical section problem? Please briefly explain.Proc (int i) {L1: while (TRUE){L2: compute;L3: while (turn != i);L4: critical_section;L5: turn = (i+1) mod 2;L6: }}shared int turn;turn = 1;fork(proc, 1, 0);fork(proc, 1, 1);
Read Details