0% found this document useful (0 votes)
24 views

Sheet 6

Uploaded by

Ebrahim Mostafa
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)
24 views

Sheet 6

Uploaded by

Ebrahim Mostafa
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

Shoubra Faculty of Engineering

Benha University

OS: Sheet #6

1. Suppose that jobs arrive according to the following schedule.

Process Starting Time Run Time


A 0 12
B 3 7
C 6 2
D 8 5
E 9 2
F 12 12

Trace the progress of the system if the scheduler used is

• First come first served.


• Shortest job first
• Shortest remaining time next

2. 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 nonpreemptive priority (a smaller priority number
implies a higher priority), and RR (quantum=1) scheduling.

Page 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 scheduling
algorithms in part a?

(d) Which of the schedules in part a results in the minimal average


waiting time (over all processes)?

3. In a three level queue with the following scheduling techniques:


The first queue: RR with quantum = 2ms.
The second queue: RR with quantum = 4ms.
The third queue: FCFS.
Four process A, B, C, and D are arrived in this order with cpu bursts: 5, 9,
13, and 2ms. Show the Gantt chart for each queue and calculate the average
waiting time.

4. Suppose that three processes exist in a uniprocessor system, as described in


table below. The system uses preemptive, round-robin scheduling, and
assume that at present T11 is running and the time quantum expires.

Process Threads within the process


P1 T11, T12, T13
P2 T21, T22
P3 T31

a) If the threads are implemented entirely at the user level (with no


support from the operating system), which threads might possibly
execute at the beginning of the next quantum?

b) If threads are supported by the operating system (i.e. kernel level


threads), which threads might possibly execute at the beginning of the
next quantum?

Page 2

You might also like