Operating Systems questions

Q22

GATE CS 2023 CSProcesses and ThreadsMSQ1 mark
Which one or more of the following need to be saved on a context switch from one thread (T1T_1) of a process to another thread (T2T_2) of the same process?
More than one option can be correct.
Show answer without attempting

Answer: B, C, D

Q23

GATE CS 2023 CSProcesses and ThreadsMSQ1 mark
Which one or more of the following options guarantee that a computer system will transition from user mode to kernel mode?
More than one option can be correct.
Show answer without attempting

Answer: C, D

Q27

GATE CS 2023 CSSchedulingMSQ1 mark
Which one or more of the following CPU scheduling algorithms can potentially cause starvation?
More than one option can be correct.
Show answer without attempting

Answer: A, C, D OR C, D

Q38

GATE CS 2023 CSConcurrency and SynchronizationMCQ2 marks−2/3 if wrong
Consider the two functions incr and decr shown below.
incr(){
wait(s);
X = X+1;
signal(s);
}
decr(){
wait(s);
X = X-1;
signal(s);
}
There are 5 threads each invoking incr once, and 3 threads each invoking decr once, on the same shared variable X. The initial value of X is 10.
Suppose there are two implementations of the semaphore s, as follows:

I-1: s is a binary semaphore initialized to 1.
I-2: s is a counting semaphore initialized to 2.

Let V1, V2 be the values of X at the end of execution of all the threads with implementations I-1, I-2, respectively.

Which one of the following choices corresponds to the minimum possible values of V1, V2, respectively?
Show answer without attempting

Answer: C

Q57

GATE CS 2023 CSMemory ManagementNAT2 marks
Consider the following two-dimensional array D in the C programming language, which is stored in row-major order:
int D[128][128];
Demand paging is used for allocating memory and each physical page frame holds 512 elements of the array D. The Least Recently Used (LRU) page-replacement policy is used by the operating system. A total of 30 physical page frames are allocated to a process which executes the following code snippet:
for (int i = 0; i < 128; i++)
  for (int j = 0; j < 128; j++)
    D[j][i] *= 10;
The number of page faults generated during the execution of this code snippet is ____________.
Show answer without attempting

Answer: 4096

Q58

GATE CS 2023 CSMemory ManagementNAT2 marks
Consider a computer system with 57-bit virtual addressing using multi-level tree-structured page tables with LL levels for virtual to physical address translation. The page size is 4 KB (1 KB=1024 B1 \text{ KB} = 1024 \text{ B}) and a page table entry at any of the levels occupies 8 bytes.

The value of LL is ____________.
Show answer without attempting

Answer: 5

0/60 correct0 marks

Related topics in GATE CS