  ### OS : 2008 GATE Questions

Questions : 4

QID : 271GATE-2008, 2M

A process executes the following code:

for (i = 0; i < n;  i++) fork();

The total number of child processes created is

Options:
A) n
B) 2^n - 1
C) 2^n
D) 2^(n+1) - 1
Ans : Option B
Solution :
QID : 269GATE-2008, 2M

The P and V operations on counting semaphores, where s is a counting semaphore, are defined as follows:

P(s) : s =  s - 1;
if (s  < 0) then wait;

V(s) : s = s + 1;
if (s <= 0) then wakeup a process waiting on s;

Assume that Pb and Vb the wait and signal operations on binary semaphores are provided. Two binary semaphores Xb and Yb are used to implement the semaphore operations P(s) and V(s) as follows:

P(s) : Pb(Xb);
s = s - 1;
if (s < 0) {
Vb(Xb) ;
Pb(Yb) ;
}
else Vb(Xb);

V(s) : Pb(Xb) ;
s = s + 1;
if (s <= 0) Vb(Yb) ;
Vb(Xb) ;

The initial values of Xb and Yb are respectively:

Options:
A) 0 and 0
B) 0 and 1
C) 1 and 0
D) 1 and 1
Ans : Option C
Solution :
QID : 270GATE-2008, 2M

Which of the following is NOT true of deadlock prevention and deadlock avoidance schemes?

Options:
A) In deadlock prevention, the request for resources is always granted if the resulting state is safe
B) In deadlock avoidance, the request for resources is always granted if the result state is safe
D) Deadlock avoidance requires knowledge of resource requirements a priori
Ans : Option A
Solution :
QID : 268GATE-2008, 1M

The data blocks of a very large file in the Unix file system are allocated using

Options:
A) contiguous allocation
C) indexed allocation
D) an extension of indexed allocation
Ans : Option D
Solution :
Inode uses single indirect block and double indirect block to extend the file size.

Submit Here

#### Previous GATE Papers

Year Key Organized by