Computer Science · Operating Systems
Consider three threads T1, T2, and T3 synchronized using binary semaphores S1, S2, and S3: T1: while(true) { wait(S3); print('C'); signal(S2); } T2: while(true) { wait(S1); print('B'); signal(S3); } T3: while(true) { wait(S2); print('A'); signal(S1); } Which initialization of semaphores (S1, S2, S3) will produce the output sequence BCABCABCA...?
- 1S1 = 1, S2 = 1, S3 = 1
- 2S1 = 1, S2 = 0, S3 = 0✓
- 3S1 = 0, S2 = 1, S3 = 1
- 4S1 = 1, S2 = 1, S3 = 0
Correct answer
S1 = 1, S2 = 0, S3 = 0
Download Single Question PDF
Save this question and verified answer as a clean study sheet with live clickable link.
Share with Friends & Study Groups
Challenge your peer aspirants on WhatsApp or Telegram to solve this question!
Preparing for Computer Science?
Practice full-length mock tests with real exam timers, instant score analysis, and all-India ranking.
Want more practice questions on Operating Systems?
Solve complete topic-wise tests with detailed solutions on GkGet.
Related Practice Questions
Recommended practice questions in Computer Science · Operating Systems