Operating Systems questions

Q10

GATE CS 2018 CSMemory ManagementMCQ1 mark−1/3 if wrong
Consider a process executing on an operating system that uses demand paging. The average time for a memory access in the system is MM units if the corresponding memory page is available in memory, and DD units if the memory access causes a page fault. It has been experimentally measured that the average time taken for a memory access in the process is XX units.

Which one of the following is the correct expression for the page fault rate experienced by the process?
Show answer without attempting

Answer: B

Q24

GATE CS 2018 CSDeadlocksNAT1 mark
Consider a system with 3 processes that share 4 instances of the same resource type. Each process can request a maximum of KK instances. Resource instances can be requested and released only one at a time. The largest value of KK that will always avoid deadlock is ____.
Show answer without attempting

Answer: 2

Q39

GATE CS 2018 CSDeadlocksMCQ2 marks−2/3 if wrong
In a system, there are three types of resources: E,FE, F and GG. Four processes P0,P1,P2P_0, P_1, P_2 and P3P_3 execute concurrently. At the outset, the processes have declared their maximum resource requirements using a matrix named Max as given below. For example, Max[P2,F]\text{Max}[P_2, F] is the maximum number of instances of FF that P2P_2 would require. The number of instances of the resources allocated to the various processes at any given state is given by a matrix named Allocation.

Consider a state of the system with the Allocation matrix as shown below, and in which 3 instances of EE and 3 instances of FF are the only resources available.

Allocation:
EEFFGG
P0P_0101
P1P_1112
P2P_2103
P3P_3200
Max:
EEFFGG
P0P_0431
P1P_1214
P2P_2133
P3P_3541
From the perspective of deadlock avoidance, which one of the following is true?
Show answer without attempting

Answer: A

Q40

GATE CS 2018 CSConcurrency and SynchronizationMCQ2 marks−2/3 if wrong
Consider the following solution to the producer-consumer synchronization problem. The shared buffer size is NN. Three semaphores empty, full and mutex are defined with respective initial values of 0,N0, N and 11. Semaphore empty denotes the number of available slots in the buffer, for the consumer to read from. Semaphore full denotes the number of available slots in the buffer, for the producer to write to. The placeholder variables, denoted by P, Q, R, and S, in the code below can be assigned either empty or full. The valid semaphore operations are: wait() and signal().

Producer:
do{
 wait(P);
 wait(mutex);
 //Add item to buffer
 signal(mutex);
 signal(Q);
}while(1);
Consumer:
do{
 wait(R);
 wait(mutex);
 //Consume item from buffer
 signal(mutex);
 signal(S);
}while(1);
Which one of the following assignments to P, Q, R and S will yield the correct solution?
Show answer without attempting

Answer: C

Q53

GATE CS 2018 CSSchedulingNAT2 marks
Consider a storage disk with 4 platters (numbered as 0, 1, 2 and 3), 200 cylinders (numbered as 0, 1, …, 199), and 256 sectors per track (numbered as 0, 1, …, 255). The following 6 disk requests of the form [sector number, cylinder number, platter number] are received by the disk controller at the same time:

[120, 72, 2] , [180, 134, 1] , [60, 20, 0] , [212, 86, 3] , [56, 116, 2] , [118, 16, 1]

Currently the head is positioned at sector number 100 of cylinder 80, and is moving towards higher cylinder numbers. The average power dissipation in moving the head over 100 cylinders is 20 milliwatts and for reversing the direction of the head movement once is 15 milliwatts. Power dissipation associated with rotational latency and switching of head between different platters is negligible.

The total power consumption in milliwatts to satisfy all of the above disk requests using the Shortest Seek Time First disk scheduling algorithm is _______.
Show answer without attempting

Answer: 85

0/50 correct0 marks

Related topics in GATE CS