Consider the following threads, T1, T2, and T3 executing on a single…

GATE · 2022 · CS · Computer Science & IT

Consider the following threads, T1, T2, and T3 executing on a single processor, synchronized using three binary semaphore variables, S1, S2, and S3, operated upon using standard wait() and signal(). The threads can be context switched in any order and at any time.

Which initialization of the semaphores would print the sequence BCABCABCA….?

  1. A.

    S1 = 1; S2 = 1; S3 = 1

  2. B.

    S1 = 1; S2 = 1; S3 = 0

  3. C.

    S1 = 1; S2 = 0; S3 = 0

  4. D.

    S1 = 0; S2 = 1; S3 = 1

Attempted by 310 students.

Show answer

Correct answer: C

The worked solution is available to enrolled students.

Video solution available to enrolled students.

Explore the full course: Iocl Engineers Officers Grade A Paper 2

Loading lesson…