• Courses
  • Tutorials
  • Jobs
  • Practice
  • Contests

GATE | CS 2022 | Question 19

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….?

(A)

S1 = 1; S2 = 1; S3 = 1

(B)

S1 = 1; S2 = 1; S3 = 0

(C)

S1 = 1; S2 = 0; S3 = 0

(D)

S1 = 0; S2 = 1; S3 = 1

Answer

Please comment below if you find anything wrong in the above post
Feeling lost in the world of random DSA topics, wasting time without progress? It's time for a change! Join our DSA course, where we'll guide you on an exciting journey to master DSA efficiently and on schedule.
Ready to dive in? Explore our Free Demo Content and join our DSA course, trusted by over 100,000 geeks!

Last Updated :
Share your thoughts in the comments