Which of the following statements is correct about Peterson's algorithm for…
2022
Which of the following statements is correct about Peterson's algorithm for process synchronisation?
Answer: C. If flag[i] is true, then process Pi is ready to enter the critical section.
- A.
It works for 3 processes only.
- B.
It uses one bool type array of size 3 bool flag [3] and int variable turn.
- C.
If flag[i] is true, then process Pi is ready to enter the critical section.
- D.
It fails when two processes want to enter the critical section at the same time.
Attempted by 686 students.
Show answer & explanation
Correct answer: C
Loading lesson…