Q22
Which one or more of the following need to be saved on a context switch from one thread () of a process to another thread () of the same process?
More than one option can be correct.
Show answer without attempting
Answer: B, C, D
GATE CS · 6 questions
6 Operating Systems questions from GATE CS papers (2023), each with the official answer key. Answer any question right here and it is marked straight away, or practise them one at a time.
Answer: B, C, D
Answer: C, D
Answer: A, C, D OR C, D
incr and decr shown below.incr(){
wait(s);
X = X+1;
signal(s);
}
decr(){
wait(s);
X = X-1;
signal(s);
}incr once, and 3 threads each invoking decr once, on the same shared variable X. The initial value of X is 10.s, as follows:s is a binary semaphore initialized to 1.s is a counting semaphore initialized to 2.X at the end of execution of all the threads with implementations I-1, I-2, respectively.Answer: C
D in the C programming language, which is stored in row-major order:int D[128][128];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;Answer: 4096
Answer: 5
0/60 correct0 marks