You are on page 1of 1

CSE 323: Operating Systems Design

Department of Electrical and Computer Engineering


North South University, Spring 2021
Final Assignment
Sec: 3
Full Marks: 40
Answer all the questions. All questions carry equal marks.

1. What are three requirements of any solution to the critical sections problem? Why
are the requirements needed?
2. What is the meaning of the term busy waiting? What other kinds of waiting are there
in an operating system? Can busy waiting be avoided altogether? Explain your answer.
3. Why do Solaris, Linux, and Windows 2000 use spinlocks as a synchronization
mechanism only on multiprocessor systems and not on single processor systems?
4. What advantage is there in having different time-quantum sizes at different levels of
a multilevel queueing system? Why is it important for the scheduler to distinguish I/O-
bound programs from CPU-bound programs?
5. What is an EDF scheduler? What is its advantage over a rate monotonic scheduler?
6. Consider the following set of processes, with the length of the CPU-burst time given
in milliseconds: Process 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, P5, all at time 0.
a. Draw four Gantt charts illustrating the execution of these processes using FCFS, SJF,
a non-preemptive priority (a smaller priority number implies a higher priority), and
RR (quantum = 1) scheduling.
b. Which of the schedules in part a result in the minimal average waiting time (over all
processes)?
7. Consider the deadlock situation that could occur in the dining-philosophers problem
when the philosophers obtain the chopsticks one at a time. Discuss how the four
necessary conditions for deadlock indeed hold in this setting. Discuss how deadlocks
could be avoided by eliminating any one of the four conditions.
8. What must the banker's algorithm know a priori in order to prevent deadlock?
Consider the following snapshot of a system:

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?

You might also like