OS Assignment 3

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 2

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.

b. The time quantum is 10 milliseconds.


Q2. What advantage is there in having different time-quantum sizes at different levels of a multilevel
queueing system?

Q3. Consider the following set of processes, with the length of the CPU burst given in milliseconds:

Process id Burst time Priority


P1 10 3
P2 1 1
P3 2 3
P4 1 4
P5 5 2

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.

Q5. Explain in detail about the Threads and their management.

Q6. Explain in detail about the Deadlock System model and Deadlock characterization.
Q7. Consider the following snapshot of a system:

Allocation Max Available

ABCD ABCD ABCD

P0 0012 0012 1520


P1 1000 1750

P2 1354 2356
P3 0632 0652
P4 0014 0656

Answer the following questions using the banker's algorithm:

a. What is the content of the matrix Need?

b. Is the system in a safe state?

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.

b. The sum of all maximum needs is less than m + n.

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

You might also like