GATE||Operating system || Pyq (2010 to 2025)

Last Updated :
Discuss
Comments

Question 1

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?
GATE CSE 2021,SET1 - [2Marks] (MSQ)


  • The value of counter is 0 after all the threads successfully complete the execution of parop.

  • The value of counter is 1 after all the threads successfully complete execution of parop. 


  • The value of counter is 5 after all the threads successfully complete the execution of parop.

  • There is a deadlock involving all the threads.

Question 2

A process executes the code

fork ();

fork ();

fork (); 

The total number of child processes created is
GATE CSE 2012 - [1Marks] (MCQ)



  • 3

  • 4

  • 7

  • 8

Question 3

A thread is usually defined as a "light weight process" because an operating system (OS) maintains smaller data structures for a thread than for a process. In relation to this, which of the following is TRUE?
GATE CSE 2011 - [1Marks] (MCQ)



  • On per-thread basis, the OS maintains only CPU register state.


  • The OS does not maintain a separate stack for each thread.


  •  On per-thread basis, the OS does not maintain virtual memory state.


  • On a per thread basis, the OS maintains only scheduling and accounting information.

Question 4

Let the time taken to switch between user and kernel modes of execution be t1 while the time taken to switch between two processes be t2. Which of the following is TRUE?
GATE CSE 2011 - [1Marks] (MCQ)



  • (t1) > (t2)


  •  (t1) = (t2)

  • (t1) < (t2)

  • Nothing can be said about the relation between t1 and t2


Question 5

 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 kB, and the disk block address is 32-bits long. The maximum possible file size is (rounded off to 1 decimal place) ______ GB.
GATE CSE 2019 - [2Marks] (NAT)


  • 4

Question 6

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 CSE 2018,SET1 - [2Marks] (NAT)


  • 85

Question 7

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 ___________.

GATE CSE 2016,SET1 - [2Marks] (NAT)


  • 346

Question 8

Suppose the following disk request sequence (track numbers) for a disk with 100 tracks is given: 45, 20, 90, 10, 50, 60, 80, 25, 70. Assume that the initial position of the R/W head is on track 50. The additional distance that will be traversed by the R/W head when the Shortest Seek Time First (SSTF) algorithm is used compared to the SCAN (Elevator) algorithm (assuming that SCAN algorithm moves towards 100 when it starts execution) is _________ tracks.

GATE 2015 SET 1, - [2Marks] (NAT)


  • 10

Question 9

Suppose a disk has 201 cylinders, numbered from 0 to 200. At some time the disk arm is at cylinder 100, and there is a queue of disk access requests for cylinders 30, 85, 90, 100, 105, 110, 135 and 145. If Shortest-Seek Time First (SSTF) is being used for scheduling the disk access, the request for cylinder 90 is serviced after servicing ____________ number of requests.

GATE CSE 2014,SET1 - [2Marks] (NAT)


  • 3

Question 10

A FAT (file allocation table) based file system is being used and the total overhead of each entry in the FAT is 4 bytes in size. Given a 100 × 106 bytes disk on which the file system is stored and data block size is 103 bytes, the maximum size of a file that can be stored on this disk in units of 10^6 bytes is ____________.

GATE CSE 2014,SET2 - [1Marks] (NAT)


  • 99.6

There are 95 questions to complete.

Take a part in the ongoing discussion