Operating Systems questions

Q19

GATE CS 2022 CSConcurrency and SynchronizationMCQ1 mark−1/3 if wrong
Consider the following threads, T1T_1, T2T_2, and T3T_3 executing on a single processor, synchronized using three binary semaphore variables, S1S_1, S2S_2, and S3S_3, operated upon using standard wait() and signal(). The threads can be context switched in any order and at any time.
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 the semaphores would print the sequence BCABCABCA....?
Show answer without attempting

Answer: C

Q26

GATE CS 2022 CSDeadlocksMSQ1 mark
Which of the following statements is/are TRUE with respect to deadlocks?
More than one option can be correct.
Show answer without attempting

Answer: A, D

Q38

GATE CS 2022 CSMemory ManagementMCQ2 marks−2/3 if wrong
Which one of the following statements is FALSE?
Show answer without attempting

Answer: C

Q42

GATE CS 2022 CSSchedulingMCQ2 marks−2/3 if wrong
Consider four processes PP, QQ, RR, and SS scheduled on a CPU as per round robin algorithm with a time quantum of 4 units. The processes arrive in the order PP, QQ, RR, SS, all at time t=0t = 0. There is exactly one context switch from SS to QQ, exactly one context switch from RR to QQ, and exactly two context switches from QQ to RR. There is no context switch from SS to PP. Switching to a ready process after the termination of another process is also considered a context switch. Which one of the following is NOT possible as CPU burst time (in time units) of these processes?
Show answer without attempting

Answer: D

Q63

GATE CS 2022 CSFile SystemsNAT2 marks
Consider two files systems AA and BB, that use contiguous allocation and linked allocation, respectively. A file of size 100 blocks is already stored in AA and also in BB. Now, consider inserting a new block in the middle of the file (between 50th50^{\text{th}} and 51st51^{\text{st}} block), whose data is already available in the memory. Assume that there are enough free blocks at the end of the file and that the file control blocks are already in memory. Let the number of disk accesses required to insert a block in the middle of the file in AA and BB are nAn_A and nBn_B, respectively, then the value of nA+nBn_A + n_B is_________.
Show answer without attempting

Answer: 153

Q64

GATE CS 2022 CSMemory ManagementNAT2 marks
Consider a demand paging system with four page frames (initially empty) and LRU page replacement policy. For the following page reference string

7,2,7,3,2,5,3,4,6,7,7,1,5,6,17, 2, 7, 3, 2, 5, 3, 4, 6, 7, 7, 1, 5, 6, 1

the page fault rate, defined as the ratio of number of page faults to the number of memory accesses (rounded off to one decimal place) is_________.
Show answer without attempting

Answer: 0.6

0/60 correct0 marks

Related topics in GATE CS