0% found this document useful (0 votes)
30 views2 pages

Final 2017-2018

Uploaded by

Aliaa Tarek
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
30 views2 pages

Final 2017-2018

Uploaded by

Aliaa Tarek
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

Electrical Engineering Department

Graduate Studies
Operating Systems
Final Exam
2017/2018
Time: 3 hrs grades: 100

Solve the following questions

Q-1) (25 points)


a- Consider a system of five processes (P1, P2, P3, P4, P5). The system contains five resources (R1,
R2, R3, R4,R5) each resource contains only one instance. P1 is holding R2 and requesting R1. P2 is
holding R1 and requesting R3, R4, R5. P3 is holding R4 and requesting R5. P4 is holding R5 and
requesting R2. P5 is holding R3.
i- Construct the resource allocation graph? (5 points)
ii- Construct the wait-for graph? (5 points)
iii- Is the system in a deadlock state? (5 points)

b- The main disadvantage of semaphores is busy waiting. What do we mean by busy waiting? How can
we overcome this problem? (10 points)

Q-2) (25 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)

Solve only three questions of the following

Q-3) (18 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)

Page 1/2 PTO


Q-4) (18 points)

Consider the following page reference string,


1,2,3,4,2,1,5,6,2,1,2,3,7,6,3,2,1,2,3,6.
Assume we have four page frames for each process. Determine the number of page faults for FIFO,
LRU and Optimal replacement algorithms. (18 points)

Q-5) (18 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)

Q-6) (18 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

You might also like