Operating systems miscellaneous
- A process executes the following code for (i = 0 ; i < n; i ++) for ();
The total number of child processes created is
-
View Hint View Answer Discuss in Forum
We know that the total number of processes is 2n but we subtract the main process therefore, total number of children = 2(n – 1) .
Correct Option: B
We know that the total number of processes is 2n but we subtract the main process therefore, total number of children = 2(n – 1) .
- Consider the following statements about user level threads and kernel level threads :
Which one of the following statements if false?
-
View Hint View Answer Discuss in Forum
Blocking one kernel level threads does not block all related threads. In kernel level threads, in blocking system call, it can happen with the kernel that another thread is scheduled while kernel is executing.
Correct Option: D
Blocking one kernel level threads does not block all related threads. In kernel level threads, in blocking system call, it can happen with the kernel that another thread is scheduled while kernel is executing.
- A single processor system has three resources types X, Y and Z, which are shared by three processes. There are 5 units of each resources type. Consider the following scenario, where the column alloc denotes the number of units of each resource type allocated to each process, and the column request denotes the number of units of each resource type requested by a process in order to complete execution. Which of these processes will finish last?
-
View Hint View Answer Discuss in Forum
From the given matrix we found that the number of available resources of X, Y and Z types are 0, 1, 2 respectively. Therefore, P1 will avail these resources first and after release the resources available will be (2, 1, 3) which will be used by P0 as its request is of 1, 0, 3 resources. After P0 releases the resources, the availability becomes (3, 3, 4) and P2 will use these resources then as per its requirements. Thus, P2 finishes in the last.
Correct Option: C
From the given matrix we found that the number of available resources of X, Y and Z types are 0, 1, 2 respectively. Therefore, P1 will avail these resources first and after release the resources available will be (2, 1, 3) which will be used by P0 as its request is of 1, 0, 3 resources. After P0 releases the resources, the availability becomes (3, 3, 4) and P2 will use these resources then as per its requirements. Thus, P2 finishes in the last.
- Consider the following code segment :
x = u – t;
y = x * v;
x = y + w;
y = t – z;
y = x * y;
The minimum number of total variables required to convert the above code segment to static single assignment form is __________.
-
View Hint View Answer Discuss in Forum
NA
Correct Option: B
NA
- 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 _______.
-
View Hint View Answer Discuss in Forum
The head movement would be :
63 => 87 24 movements
87 => 92 5 movements
92 => 121 29 movements
121 => 191 70 movements
191 => 10 0 movement
10 => 11 1 movement
11 => 38 27 movements
38 => 47 9 movements
Total head movements = 165Correct Option: A
The head movement would be :
63 => 87 24 movements
87 => 92 5 movements
92 => 121 29 movements
121 => 191 70 movements
191 => 10 0 movement
10 => 11 1 movement
11 => 38 27 movements
38 => 47 9 movements
Total head movements = 165