Consider the following proposed solution to the critical-section problem for two
ID: 3775431 • Letter: C
Question
Consider the following proposed solution to the critical-section problem for two processes p_0 and p_1. The processes share the following data structure: Boolean ready [2];//initialized to false and int pro://initialized to 0 or 1. The structure of process p_0 is as follows. The other process p_1 has similar structure. while (TRUE) (ready [0] = TRUE: while (ready[1]) {if (proc ** 1) {ready [0] = FALSE; while (proc ** 1): ready [0] = TRUE;}//end- if}//end - while {....}//critical section proc = 0: ready [0] = FALSE; {....}//REMAINDER section}//end- while Does the solve the critical section problem for p_0 and p_1? if so, explain how. if not, then explain why not (without proper justification correct answer will not get full credit)Explanation / Answer
Change the second while loop to
while(ready[0])--------------so that it will enter in the loop to check the condition
all other code is correct.