OS Assignment 3
OS Assignment 3
Note: Attempt all questions and give the logical answer in a precise manner.
Q1: Consider a system running ten I/O-bound tasks and one CPU-bound task. Assume that the I/O-
bound tasks issue an I/O operation once for every millisecond of CPU computing and that each I/O
operation takes 10 milliseconds to complete. Also, assume that the context-switching overhead is 0.1
millisecond and that all processes are long-running tasks. Describe the CPU utilization for a round-
robin scheduler when:
a. The time quantum is 1 millisecond.
Q3. Consider the following set of processes, with the length of the CPU burst given in milliseconds:
The processes are assumed to have arrived in the order P1, P2, P3, P4, Ps, all at time 0.
a. Draw four Gantt charts that illustrate the execution of these processes using the following
scheduling algorithms: FCFS, SJF, nonpreemptive priority (a smaller priority number implies a higher
priority), and RR (quantum= 1).
b. What is the turnaround time of each process for each of the scheduling algorithms in part a?
c. What is the waiting time of each process for each of these scheduling algorithms?
d. Which of the algorithms results in the minimum average waiting time (over all processes)?
Q4. Define process and process control block. Also, describe the process state transition diagram in
detail.
Q6. Explain in detail about the Deadlock System model and Deadlock characterization.
Q7. Consider the following snapshot of a system:
P2 1354 2356
P3 0632 0652
P4 0014 0656
c. If a request from process P1 arrives for (0, 4, 2, 0), can the request be granted immediately?
Q8. Consider a system consisting of m resources of the same type being shared by n processes. A
process can request or release only one resource at a time. Show that the system is deadlock-free if
the following two conditions hold:
a. The maximum need of each process is between one resource and m resources.
Q9. Is it possible to have a deadlock involving only a single process? Explain your answer.
Q10. Compare the circular-wait scheme with the various deadlock-avoidance schemes (like the
banker's algorithm) with respect to the following issues:
a. Runtime overheads
b. System throughput