Operating Systems questions

Q11

GATE CS 2021 CS-1Memory ManagementMSQ1 mark
In the context of operating systems, which of the following statements is/are correct with respect to paging?
More than one option can be correct.
Show answer without attempting

Answer: A, C

Q14

GATE CS 2021 CS-1Processes and ThreadsMSQ1 mark
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?
More than one option can be correct.
Show answer without attempting

Answer: A, C

Q15

GATE CS 2021 CS-1File SystemsMSQ1 mark
Consider a linear list based directory implementation in a file system. Each directory is a list of nodes, where each node contains the file name along with the file metadata, such as the list of pointers to the data blocks. Consider a given directory foo.
Which of the following operations will necessarily require a full scan of foo for successful completion?
More than one option can be correct.
Show answer without attempting

Answer: A, C

Q25

GATE CS 2021 CS-1SchedulingNAT1 mark
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.
Show answer without attempting

Answer: 12

Q46

GATE CS 2021 CS-1Concurrency and SynchronizationMSQ2 marks
Consider the following pseudocode, where S is 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?
More than one option can be correct.
Show answer without attempting

Answer: A, B, D

Q14

GATE CS 2021 CS-2SchedulingMSQ1 mark
Which of the following statement(s) is/are correct in the context of CPU scheduling?
More than one option can be correct.
Show answer without attempting

Answer: A, C, D

Q42

GATE CS 2021 CS-2Processes and ThreadsMSQ2 marks
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?
More than one option can be correct.
Show answer without attempting

Answer: A, D

Q43

GATE CS 2021 CS-2DeadlocksMSQ2 marks
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?
More than one option can be correct.
Show answer without attempting

Answer: A, B, C

Q48

GATE CS 2021 CS-2Memory ManagementNAT2 marks
Consider a three-level page table to translate a 39-bit virtual address to a physical address as shown below.

The page size is 4KB (1KB=2101\text{KB} = 2^{10} bytes) and page table entry size at every level is 8 bytes. A process PP is currently using 2GB (1GB=2301\text{GB} = 2^{30} bytes) virtual memory which is mapped to 2GB of physical memory. The minimum amount of memory required for the page table of PP across all levels is ____________ KB.
Question figure
Show answer without attempting

Answer: 4108

0/90 correct0 marks

Related topics in GATE CS