Recent questions tagged peterson-algorithm

4 4 votes
1 1 answer
164
164 views
Consider the following alternative entry code for process $P_i$:$\texttt{wants[i] = 1}$;$\texttt{while(wants[1 - i]);}$The shared array $\texttt{wants}$ is initially:$\te...
2 2 votes
1 1 answer
121
121 views
Two threads execute Peterson’s entry code. The following statements execute in this exact order:$T_0:$ $\texttt{flag[0] = true}$$T_0:$ $\texttt{turn = 1}$$T_1:$ $\texttt{...
4 4 votes
1 1 answer
149
149 views
Consider the following variation of Peterson’s algorithm for process $P_i$:$\texttt{flag[i] = TRUE;}$$\texttt{turn = i;}$$\texttt{while(flag[j] \&\& turn == j);}$$\texttt...
2 2 votes
1 1 answer
127
127 views
Which of the following statements are correct?Both strict alternation and Peterson’s solution use busy waiting. Both strict alternation and Peterson’s solution satisfy th...
7 7 votes
1 1 answer
198
198 views
Which of the following statements about Peterson’s solution are correct?Peterson’s solution uses atomic load and store operations. Peterson’s solution directly supports a...
4 4 votes
1 1 answer
249
249 views
Two processes $P_i$ and $P_j$ use Peterson’s solution:$\texttt{flag[i] = TRUE;}$$\texttt{turn = j;}$$\texttt{while(flag[j] \&\& turn == j);}$$\texttt{Critical Section}$$\...
6 6 votes
1 1 answer
1.8k
1.8k views
Consider Peterson's algorithm for Mutual Exclusion between two concurrent processes $w$ and $f$. The program executed by the processeses are shown below:Process wProcess ...
To see more, click for the full list of questions or popular tags.