Operating System

Question 1
Consider a three-level page table to translate a 39-bit virtual address to a physical address as shown below:

The page size is 4 KB = (1KB =2^{10} bytes) and page table entry size at every level is 8 bytes. A process P is currently using 2 GB (1 GB =2^{30} bytes) virtual memory which os mapped to 2 GB of physical memory. The minimum amount of memory required for the page table of P across all levels is _________ KB
A
1024
B
4096
C
4108
D
1864
GATE CSE 2021 SET-2      Memory Management
Question 2
Consider a computer system with multiple shared resource types, with one instance per resource type. Each instance can be owned by only one process at a time. Owning and freeing of resources are done by holding a global lock (L). The following scheme is used to own a resource instance:
 function OWNRESOURCE(Resource R) 
    Acquire lock L // a global lock 
    if R is available then 
        Acquire R        
        Release lock L 
    else
        if R is owned by another process P then        
        Terminate P, after releasing all resources owned by P        
        Acquire R        
        Restart P        
        Release lock L        
        end if
    end if    
end function
Which of the following choice(s) about the above scheme is/are correct?
[MSQ]
A
The scheme ensures that deadlocks will not occur
B
The scheme may lead to live-lock
C
The scheme may lead to starvation
D
The scheme violates the mutual exclusion property
GATE CSE 2021 SET-2      Process Synchronization
Question 3
Consider the following multi-threaded code segment (in a mix of C and pseudo-code), invoked by two processes P1 and P2, and each of the processes spawns two threads T1 and T2:
int x = 0;  // global
Lock L1;    // global
main () { 
    create a thread to execute foo( ); // Thread T1
    create a thread to execute foo( ); // Thread T2
    wait for the two threads to finish execution;
    print(x);}
    
    
foo() {
    int y = 0;
    Acquire L1;
    x = x + 1;
    y = y + 1;
    Release L1;
    print (y);} 
Which of the following statement(s) is/are correct?
[MSQ]
A
Both P1 and P2 will print the value of x as 2.
B
At least of P1 and P2 will print the value of x as 4.
C
At least one of the threads will print the value of y as 2.
D
Both T1 and T2, in both the processes, will print the value of y as 1.
GATE CSE 2021 SET-2      Thread
Question 4
Which of the following statement(s) is/are correct in the context of CPU scheduling?
[MSQ]
A
Turnaround time includes waiting time
B
The goal is to only maximize CPU utilization and minimize throughput
C
Round-robin policy can be used even when the CPU time required by each of the processes is not known apriori
D
Implementing preemptive scheduling needs hardware support
GATE CSE 2021 SET-2      CPU Scheduling
Question 5
Consider the following pseudocode, where Sis a semaphore initialized to 5 in line #2 and counter is a shared variable initialized to 0 in line #1. Assume that the increment operation in line #7 is not atomic.
1.  int counter =0;
2.  Semaphore S= init(5);
3.  void parop(void)
4.  {
5.         wait(S);
6.         wait(S);
7.         counter++;
8.         signal(S);
9.          signal(S);
10.  } 
If five threads execute the function parop concurrently, which of the following program behavior(s) is/are possible?
[MSQ]
A
The value of countercounter is 5 after all the threads successfully complete the execution of parop.
B
The value of countercounter is 1 after all the threads successfully complete the execution of parop.
C
The value of countercounter is 0 after all the threads successfully complete the execution of parop.
D
There is a deadlock involving all the threads.
GATE CSE 2021 SET-1      Process Synchronization
Question 6
Three processes arrive at time zero with CPU bursts of 16, 20 and 10 milliseconds. If the scheduler has prior knowledge about the length of the CPU bursts, the minimum achievable average waiting time for these three processes in a non-preemptive scheduler (rounded to nearest integer) is _____________ milliseconds.
A
18.66
B
12
C
15
D
9
GATE CSE 2021 SET-1      CPU Scheduling
Question 7
Which of the following standard C library functions will always invoke a system call when executed from a single-threaded process in a UNIX/Linux operating system?
[MSQ]
A
exit
B
malloc
C
sleep
D
strlen
GATE CSE 2021 SET-1      System Call
Question 8
In the context of operating systems, which of the following statements is/are correct with respect to paging?
[MSQ]
A
Paging helps solve the issue of external fragmentation
B
Page size has no impact on internal fragmentation
C
Paging incurs memory overheads
D
Multi-level paging is necessary to support pages of different sizes
GATE CSE 2021 SET-1      Memory Management
Question 9
Remote Procedure Calls are used for
A
communication between two processes remotely different from each other on the same system
B
communication between two processes on the same system
C
communication between two processes on the separate systems
D
none of the above
ISRO CSE 2020      Process Synchronization
Question 9 Explanation: 
NOTE: Question is excluded from the evaluation due to ambiguity.
Click here for detail solution by gateoverflow
Question 10
The hardware implementation which provides mutual exclusion is
A
Semaphores
B
Test and set instructions
C
Both options
D
None of the options
ISRO CSE 2020      Process Synchronization


There are 10 questions to complete.

Leave a Comment

Like this FREE website? Please share it among all your friends and join the campaign of FREE Education to ALL.