Operating System GATE 2022 Solved Questions
Ques 1: 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. GATE 2022 Q no 19 T1 T2 T3 while(true){wait(S3);print(“C”);signal(S2); } while(true){wait(S1);print(“B”);signal(S3); } while(true){wait(S2);print(“A”);signal(S1); } Which initialization of the semaphores would print the sequence BCABCABCA…? (A) …