Operating System | Gate-2018| Previous year question|Set-3

Set-15 Operating System Questions

1. Consider a process executing on an operating system that uses demand paging. The average time for a memory access in the system is M units if the corresponding memory page is available in memory and D 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 X units.

Which one of the following is the correct expression for the page fault rate experienced by the process? [GATE – 2018]

a. (D-M)/(X-M)
b. (X-M)/(D-M)
c. (D-X)/(D-M)
d. (X-M)/(D-X)

Answer : b)


2. Consider a system with 3 processes that share 4 instances of the same resource type. Each process can request a maximum of K instances. Resource instances can be requested and released only one at a time. The largest value of K that will always avoid deadlock is _________. [GATE – 2018]

a. 2
b. 3
c. 4
d. 5

Answer :  a)


3. Consider the following solution to the producer-consumer synchronization problem. The shared buffer size is N. Three semaphores empty, full and mutex are defined with respective initial values of 0, N and 1. 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 sigmal().

ProducerConsumer
do
{
wait(P);
wait (mutex);
// Add item to buffer
Signal (mutex);
Signal (Q);
}
while (1);
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? [GATE – 2018]

a. P: full, Q: full, R: empty, S: empty
b. P: empty, Q: empty, R: full, S: full
c. P: full, Q: empty, R: empty, S: full
d. P: empty, Q: full, R: full, S: empty

Answer : c)
Operating System | Gate-2018|


4. 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 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 ______ . [GATE – 2018]

a. 85
b. 86
c. 87
d. 88

Answer : a)
Operating System | Gate-2018|


5. In a system, there are three types of resources: E, F and G. Four processes P0, P1, P2 and P3 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] is the maximum number of instances of F that P2 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 E and 3 instances of F are the only resources available.

From the perspective of deadlock avoidance, which one of the following is true? [GATE – 2018]

a. The system is in safe state.
b. The system is not in safe state, but would be safe if one more instance of E were available.
c. The system is not in safe state, but would be safe if one more instance of F were available.
d. The system is not in safe state, but would be safe if one more instance of G were available.

Answer : a)


Back to GATE-HOME


Spread the love

Leave a Comment

Your email address will not be published. Required fields are marked *