Operating Systems questions — page 4 of 7

Q39

GATE CS 2019 CSDeadlocksMCQ2 marks−2/3 if wrong
Consider the following snapshot of a system running nn concurrent processes. Process ii is holding XiX_i instances of a resource R, 1≤i≤n1 \le i \le n. Assume that all instances of R are currently in use. Further, for all ii, process ii can place a request for at most YiY_i additional instances of R while holding the XiX_i instances it already has. Of the nn processes, there are exactly two processes pp and qq such that Yp=Yq=0Y_p = Y_q = 0. Which one of the following conditions guarantees that no other process apart from pp and qq can complete execution?
Show answer without attempting

Answer: A

Q41

GATE CS 2019 CSSchedulingNAT2 marks
Consider the following four processes with arrival times (in milliseconds) and their length of CPU bursts (in milliseconds) as shown below:
ProcessP1P2P3P4
Arrival time0134
CPU burst time313Z
These processes are run on a single processor using preemptive Shortest Remaining Time First scheduling algorithm. If the average waiting time of the processes is 11 millisecond, then the value of Z is __________.
Show answer without attempting

Answer: 2

Q42

GATE CS 2019 CSFile SystemsNAT2 marks
The index node (inode) of a Unix-like file system has 12 direct, one single-indirect and one double-indirect pointers. The disk block size is 4 kB4\text{ kB}, and the disk block address is 32-bits long. The maximum possible file size is (rounded off to 1 decimal place) __________ GB.
Show answer without attempting

Answer: 3.7 to 3.8 OR 4.0 to 4.1

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

Q18

GATE CS 2017 CS-1Processes and ThreadsMCQ1 mark−1/3 if wrong
Threads of a process share
Show answer without attempting

Answer: D

Q24

GATE CS 2017 CS-1SchedulingNAT1 mark
Consider the following CPU processes with arrival times (in milliseconds) and length of CPU bursts (in milliseconds) as given below:
ProcessArrival timeBurst time
P107
P233
P355
P462
If the pre-emptive shortest remaining time first scheduling algorithm is used to schedule the processes, then the average waiting time across all processes is ____________ milliseconds.
Show answer without attempting

Answer: 3.0

Q27

GATE CS 2017 CS-1Concurrency and SynchronizationMCQ2 marks−2/3 if wrong
A multithreaded program PP executes with xx number of threads and uses yy number of locks for ensuring mutual exclusion while operating on shared memory locations. All locks in the program are non-reentrant, i.e., if a thread holds a lock ll, then it cannot re-acquire lock ll without releasing it. If a thread is unable to acquire a lock, it blocks until the lock becomes available. The minimum value of xx and the minimum value of yy together for which execution of PP can result in a deadlock are:
Show answer without attempting

Answer: D

Q40

GATE CS 2017 CS-1Memory ManagementMCQ2 marks−2/3 if wrong
Recall that Belady's anomaly is that the page-fault rate may increase as the number of allocated frames increases. Now, consider the following statements:

S1: Random page replacement algorithm (where a page chosen at random is replaced) suffers from Belady's anomaly
S2: LRU page replacement algorithm suffers from Belady's anomaly

Which of the following is CORRECT?
Show answer without attempting

Answer: B

Q7

GATE CS 2017 CS-2Processes and ThreadsMCQ1 mark−1/3 if wrong
Which of the following is/are shared by all the threads in a process?

I. Program counter
II. Stack
III. Address space
IV. Registers
Show answer without attempting

Answer: B

Q8

GATE CS 2017 CS-2File SystemsMCQ1 mark−1/3 if wrong
In a file allocation system, which of the following allocation scheme(s) can be used if no external fragmentation is allowed?

I. Contiguous
II. Linked
III. Indexed
Show answer without attempting

Answer: D

Q33

GATE CS 2017 CS-2DeadlocksMCQ2 marks−2/3 if wrong
A system shares 9 tape drives. The current allocation and maximum requirement of tape drives for three processes are shown below:
ProcessCurrent AllocationMaximum Requirement
P137
P216
P335
Which of the following best describes current state of the system?
Show answer without attempting

Answer: B

Q51

GATE CS 2017 CS-2SchedulingNAT2 marks
Consider the set of processes with arrival time (in milliseconds), CPU burst time (in milliseconds), and priority (0 is the highest priority) shown below. None of the processes have I/O burst time.
ProcessArrival TimeBurst TimePriority
P1P_10112
P2P_25280
P3P_31223
P4P_42101
P5P_59164
The average waiting time (in milliseconds) of all the processes using preemptive priority scheduling algorithm is ____________.
Show answer without attempting

Answer: 29.0

Q20

GATE CS 2016 CS-1SchedulingMCQ1 mark−1/3 if wrong
Consider an arbitrary set of CPU-bound processes with unequal CPU burst lengths submitted at the same time to a computer system. Which one of the following process scheduling algorithms would minimize the average waiting time in the ready queue?
Show answer without attempting

Answer: A

Q47

GATE CS 2016 CS-1Memory ManagementNAT2 marks
Consider a computer system with 40-bit virtual addressing and page size of sixteen kilobytes. If the computer system has a one-level page table per process and each page table entry requires 48 bits, then the size of the per-process page table is ________ megabytes.
Show answer without attempting

Answer: 384.0

Q48

GATE CS 2016 CS-1SchedulingNAT2 marks
Consider a disk queue with requests for I/O to blocks on cylinders 47, 38, 121, 191, 87, 11, 92, 10. The C-LOOK scheduling algorithm is used. The head is initially at cylinder number 63, moving towards larger cylinder numbers on its servicing pass. The cylinders are numbered from 0 to 199. The total head movement (in number of cylinders) incurred while servicing these requests is ________.
Show answer without attempting

Answer: 346.0

Q49

GATE CS 2016 CS-1Memory ManagementNAT2 marks
Consider a computer system with ten physical page frames. The system is provided with an access sequence (a1,a2,…,a20,a1,a2,…,a20)(a_1, a_2, \dots, a_{20}, a_1, a_2, \dots, a_{20}), where each aia_i is a distinct virtual page number. The difference in the number of page faults between the last-in-first-out page replacement policy and the optimal page replacement policy is ________.
Show answer without attempting

Answer: 1.0

0/200 correct0 marks

Related topics in GATE CS