Professional Documents
Culture Documents
Systems
(Classroom Practice Booklet Solutions)
overheads, but if we consider overhead(s) 15. Ans: (d) 16. Ans: (a)
then it would be ns+(n-1)q So, ns+(n-1)q 17. Ans: (b)
<= t overhead will be reduced when time Sol: Consider the each statement:
quantum is maximum allowable i.e., (i) Statement is false because there is no
q = (t–ns)/(n–1). connection between kernel supported
P1 Free P2 P3 P2 P1 P3 P1 P2 Free P2 threads and context switch.
0 1 2 3 5 6 8 9 10 11 14 15
(ii) Statement is true and it is drawback of
P1 I/O P2 I/O
P3 I/O user-level threads.
12. Ans: (b) (iii) Statement is true because kernel-
Sol: P1 → Finishing time = 10 supported threads having own memory
P2 → Finishing time = 15 area and scheduled independently by
P3 → Finishing time = 9 the OS.
(iv) Statement is false because kernel is
13. Ans: (b) unaware about user level threads and
Sol: Draw the Gantt Chart and observe the CPU there is no kernel support to user-level
idle times. threads.
Process Burst Time I/O Time CPU Time I/O Time
18. Ans: (b)
P1 10 2 7 1
Sol: The critical distinction between them is data
P2 20 4 14 2
P3 30 6 21 3 sharing processes do not share address space
without explicit assistance. Threads within a
Draw the Gantt chart and observe the CPU
process share address space.
idle time.
19. Ans: (c)
IDLE P1 P2 P3 IDLE
0 2 9 23 44 47 Sol: RR is a pre-emptive scheduler, which is
designed especially for time-sharing
% OF TIME CPU IS IDLE = 5/47 × 100
systems. In other words, it does not wait for
= 10.6
a process to finish or give up control. In RR,
each process is given a time slot to run.
14. Ans: (c)
If the process does not finish, it will “get
Sol: Hint: Draw the Gantt- Chart.
back in line” and receive another time slot
until it has completed.
ACE Engineering Publications Hyderabad|Delhi|Bhopal|Pune|Bhubaneswar| Lucknow|Patna|Bengaluru|Chennai|Vijayawada|Vizag |Tirupati | Kukatpally| Kolkata
: 3 : CSIT‐Postal Coaching Solutions
28. 31.
Sol: The process will have increases it priority Sol: Run in the order
because of two pointers pointing same x, 3, 5, 6, if x < 3
process. The advantage is, it will be given else 3, x, 5, 6, if x > 3 & x < 5
more time but shorter processes will suffer. else 3, 5, x, 6 if x > 5 & x < 6
else 3, 5, 6, x if x > 6
29.
by applying SJF; as it generates the least
Sol: CPU efficiency
any waiting time.
= CPU useful time/ total CPU time.
There are only two main choices FCFS and Average waiting time
SJF as no priority and Quantum size etc. has 0 3 7 12 11
= = = 5.5
been given. Moreover x may take values 4 2
that the job responses immediately after Thus, the order of execution depends on the
getting the CPU. Then response time will be value of x and average response time is
Case: 4 x = 4.
03. Ans: (b)
3 x 5 6 Sol: The semaphore value S = 7.
0 3 7 12 18 P operation will decrement the value of the
semaphore by 1.
L2 : P(Sy) L4 : P(Sy)
13. Ans: (d)
x = x + 1; y = y + 1;
Sol: Fetch-And_Add( ) is stated as atomic.
y = y 1; x = y – 1;
Therefore, even if pre-emption takes place
V(Sx); V(Sy);
within the while loop, the other process will
V(Sy); V(Sx);
be denied the access to CS.
} }
ACE Engineering Publications Hyderabad|Delhi|Bhopal|Pune|Bhubaneswar| Lucknow|Patna|Bengaluru|Chennai|Vijayawada|Vizag |Tirupati | Kukatpally| Kolkata
: 6 : Operating Systems
after granting the request. However if it Sol: Single level paging has overhead of large
If FIFO page replacement algorithm is used locality of reference, also known as the
used variable that was initialized very early the same value or related storage locations
= 214-k Bytes
01. Ans: (b)
By given condition 214-k =2k, (k=7)
Sol: Nearest cylinder next is also known as
and hence page size = 27=128 Bytes.
shortest seek time first which is the optimal
56. algorithm.
219 *100 ns
Sol: = 51 approx 02. Ans: (b)
100 ms
Sol: To facilitate/minimize the Disk access time.
0 0 0 1 1 0 0 0 0 1 0 1 1 0 1 Free