The following is a solution to the shared account balance pr…

The following is a solution to the shared account balance problem. balance.jpg 1.suppose we change the line “semaphore mutex = 1;” to “semaphore mutex = 0;”. Is the solution still correct? Please briefly explain.         2.suppose we change the line “semaphore mutex = 1;” to “semaphore mutex = 2;”. Is the solution still correct? Please briefly explain.

We have discussed the following problem: I.When process p1…

We have discussed the following problem: I.When process p1 is invoked, p1 will delete one element from L and decrease Len by 1. II.When process p2 is invoked, p2 will insert one integer into L and increase Len by 1; spring 2026 deadlock.jpg a.Is the solution illustrated in Figure 6.2 correct? Please use ONE EXAMPLE to briefly justify your answer. Note: No credit will be given if NO Example is used. b.please design a monitor to solve the problem illustrated in Figure 7.1

Is 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){while (TRUE) {               Compute;               flag[i] = TRUE;               while (flag[(i+1) mod 2]);               critical_section;               flag[i] = FALSE;}}Shared Boolean flag[2];flag[0] = flag[1] = FALSE;fork(proc, 1, 0);fork(proc, 1, 1);