Final 2017-2018
Final 2017-2018
Graduate Studies
Operating Systems
Final Exam
2017/2018
Time: 3 hrs grades: 100
b- The main disadvantage of semaphores is busy waiting. What do we mean by busy waiting? How can
we overcome this problem? (10 points)
a- What is the main function of short-term, medium-term and long-term schedulers? Describe the
differences between them in terms of response time and frequency of use? (15 points)
b- Can a system detect that some of its processes are starving? If you answer “yes,” explain how it
can? Explain how the system can deal with the starvation problem? (10 points)
a- Consider the following set of processes, with the length of the CPU-burst time given in milliseconds:
Process P1 P2 P3 P4
Arrival Time 0.0 1.0 2.0 4.0
Burst Time 8 4 1 2
1. What is the average turnaround and waiting times for these processes with the FCFS scheduling
algorithm?
2. Repeat part (a) for the non-preemptive SJF scheduling algorithm?
3. Repeat part (a) for the preemptive SJF scheduling algorithm?
b- Discuss how the following pairs of scheduling criteria conflict in certain settings. (6 points)
a- Given memory partitions of 100K, 500K, 200K, 300K, and 600K (in order), how would each of the
First-fit, Best-fit, and Worst-fit algorithms place processes of 212K, 417K, 112K, and 426K (in order)?
Which algorithm makes the most efficient use of memory? (12 points)
b- Assume we have a demand paged memory. It takes 25 ms to service a page fault. Memory access
time is 100 ns. What is the effective memory access time if the page fault rate is 0.001. What is the
page fault rate if the required EAT is no more than 110 ns? (6 points)
a- What is the cause of thrashing? How does the system detect thrashing? Once it detects thrashing,
what can the system do to eliminate this problem? (9 points)
b- What are the benefits of using threads? What resources are used when a thread is created? How do
they differ from those used when a process is created? (9 points)
Page 2/2
Best Wishes Dr. Ahmed Mostafa