Operating Systems questions

Q17

GATE CS 2019 CSProcesses and ThreadsNAT1 mark
The following C program is executed on a Unix/Linux system:
#include <unistd.h>
int main()
{
    int i;
    for (i=0; i<10; i++)
        if (i%2 == 0) fork();
    return 0;
}
The total number of child processes created is __________.
Show answer without attempting

Answer: 31

Q23

GATE CS 2019 CSConcurrency and SynchronizationNAT1 mark
Consider three concurrent processes P1, P2 and P3 as shown below, which access a shared variable D that has been initialized to 100.
P1P2P3
⋮\vdots⋮\vdots⋮\vdots
D=D+20\text{D} = \text{D} + 20D=D−50\text{D} = \text{D} - 50D=D+10\text{D} = \text{D} + 10
⋮\vdots⋮\vdots⋮\vdots
The processes are executed on a uniprocessor system running a time-shared operating system. If the minimum and maximum possible values of D after the three processes have completed execution are X and Y respectively, then the value of Y−XY - X is __________.
Show answer without attempting

Answer: 80

Q33

GATE CS 2019 CSMemory ManagementMCQ2 marks−2/3 if wrong
Assume that in a certain computer, the virtual addresses are 64 bits long and the physical addresses are 48 bits long. The memory is word addressable. The page size is 8 kB8\text{ kB} and the word size is 44 bytes. The Translation Look-aside Buffer (TLB) in the address translation path has 128128 valid entries. At most how many distinct virtual addresses can be translated without any TLB miss?
Show answer without attempting

Answer: B

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

0/60 correct0 marks

Related topics in GATE CS