Which of the following statements is correct about Peterson's algorithm for…

Which of the following statements is correct about Peterson's algorithm for process synchronisation?

  1. A.

    It works for 3 processes only.

  2. B.

    It uses one bool type array of size 3 bool flag [3] and int variable turn.

  3. C.

    If flag[i] is true, then process Pi is ready to enter the critical section.

  4. D.

    It fails when two processes want to enter the critical section at the same time.

Attempted by 161 students.

Sign up free to check your answer

Sign up free

Explore the full course: Gate Guidance By Sanchit Sir

Loading lesson…