CS3009
CS3009
Note: Answer all Questions. Questions can be answered in any serial order. However,
ensure that all parts of a question are answered sequentially.
1. (a) What are the primary and secondary goals of an OS? Explain with reasoning. [2]
(c) Differentiate between Distributed and Network Operating Systems with diagrams. Which one
among these is called a tightly coupled system. [2]
(d) List the different Process States in OS. How many states a process must pass through in its life-
cycle to complete? Where do these states reside in memory? [2]
(e) Differentiate between Long-term scheduler and Short-term scheduler. What is the job of a
Dispatcher? [2]
(b) Consider three processes, all arriving at time zero, with total execution time of 10, 20 and 30 units,
respectively. Each process spends the first 20% of execution time doing I/O, the next 70% of time doing
computation, and the last 10% of time doing I/O again. The operating system uses a shortest remaining
compute time first scheduling algorithm and schedules a new process either when the running process
gets blocked on I/O or when the running process finishes its compute burst. Assume that all I/O
operations can be overlapped as much as possible. Compute the percentage of time the CPU remain
idle. [4]
(c) The following program consists of 3 concurrent processes and 3 binary semaphores. The semaphores
are initialized as S0 = 1, S1 = 0, S2 = 0. [4]
How many minimum and maximum times will process P0 print ‘0’? Assume that the process P1 and P2
run exactly once.
1
NATIONAL INSTITUTE OF TECHNOLOGY ROURKELA
MID SEMESTER EXAMINATION, 2023
SESSION: 2023 – 2024 (Autumn)
3. (a) What is Race Condition? Two processes, P1 and P2, need to access a critical section of code.
Consider the following synchronization construct used by the processes: [5]
Process P1 Process P2
while (true) { while (true) {
wants1 = true; wants2 = true;
while (wants2 == true); while (wants1==true);
/* Critical Section */ /* Critical Section */
wants1=false; wants2 = false;
} }
The initial values of shared boolean variables wants1 and wants2 are randomly assigned. Examine and
explain the feasibility of the solution w.r.t all the required criteria. Also, explain if the deadlock is
possible while processes try to access the critical section of the code.
(b) Consider the set of five processes whose arrival time and burst time are given below: [3]