You are on page 1of 4

1.

Suppose the following jobs arrive for processing at the times indicated, each job will
run the listed amount of time.
Jobs Arrival tie Burst time
(in secs.)
1 0.0 8
2 0.4 4
3 1.0 1
Give Gantt charts illustrating the execution of these jobs using the non preemptive FCFS
and SJF scheduling algorithms. Compute the average turn around time and average
waiting time of each job for above algorithms.

2. Given the following information about jobs:

Job Time Arrival Priority


1 8 0 3
2 4 0 2
3 6 0 1
4 1 0 4

All jobs arrive at time 0(but in the order 1, 2, 3&4).Draw charts and calculate the average
time to complete (turn-around time) using the following scheduling algorithms: FCFS,
SJF, Priority scheduling and round Robin (t=2)

3. Suppose we have a single processor system, and jobs arrive at a rate of 10 jobs a
Seconds, suppose each job takes an average of 50 milli seconds to complete. Assure
that both distributions are exponential. What is the expected number of jobs in the
system and the average time in the system?

4. For the following set of processes:

Process Burst Time Priority

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

The processes have arrived in the order P2, P1, P4, P3 and P5.Obtain the Gantt chart and
waiting time for the following types of scheduling.

5.

Process Number Time to completion Time of arrival


1 40 0
2 30 5

3 15 25
4 25 50
5 20 70

a. Create the Gantt chart for FCFS Scheduling and compute the turnaround
time for Process 3.
b. Create Gantt chart for Shortest Remaining time.
What is the difference between the average times for FCFS and Shortest
Remaining time?
5. Consider three CPU-intensive processes, which require 10, 20 and 30 time units
and arrive at times 0, 2 and 6, respectively. How many context switches are
needed if the operating system implements a shortest remaining time first
scheduling algorithm? Do not count the context switches at time zero and at the
end.
Assume that the following jobs are to be executed on a single processor
system
6. -----------------------
Job-Id CPU-BurstTime
-----------------------
p 4
q 1
r 8
s 1
t 2
-----------------------
The jobs are assumed to have arrived at time 0 and in the order p, q, r, s,
t. Calculate the departure time (completion time) for job p if scheduling is
round robin with time slice 1.
7. The sequence …………… is an optimal non-preemptive scheduling sequence for the
following jobs which leaves the CPU idle for ………………… unit(s) of time.
----------------------------
Job Arrival_Time Burst_Time
----------------------------
1 0.0 9
2 0.6 5
3 1.0 1
----------------------------
answer options:
(a) {3,2,1),1 (b) (2,1,3},0
(c) {3,2,1),0 (d) {1,2,3},5

8. Consider the following set of processes, with the arrival times and the CPU
burst times given in milliseconds.
-------------------------------------
Process Arrival-Time Burst-Time
-------------------------------------
P1 0 5
P2 1 3
P3 2 3
P4 4 1
-------------------------------------
What is the average turnaround time for these processes with the preemptive
shortest remaining processing time first (SROT) algorithm?
9. Consider the following table of arrival time and burst time for three processes P0,
P1 and P2.
-----------------------------------
Process Arrival time Burst Time
-----------------------------------
P0 0 ms 9 ms
P1 1 ms 4 ms
P2 2 ms 9 ms
-----------------------------------
The pre-emptive shortest job first scheduling algorithm is used. Scheduling is
carried out only at arrival or completion of processes. What is the average waiting
time for the three processes?
An operating system uses Shortest Remaining Time first (SRT) process
scheduling algorithm. Consider the arrival times and execution times for the
following processes:
-------------------------------------
Process Execution time Arrival time
-------------------------------------
P1 20 0
P2 25 15
P3 10 30
P4 15 45
-------------------------------------
What is the total waiting time for process P2?

10. Assume a page size of 1K and a 15-bit logical address space.

How many pages are in the system?

11. Find which memory allocation algorithm will be best.

List of Size Turnaround Memory Block Size


Jobs Block 1 50k
Job 1 100k 3 Block 2 200k
Block 3 70k
Job 2 10k 1
Block 4 115k
Job 3 35k 2 Block 5 15k
Job 4 15k 1
Job 5 23k 2
Job 6 6k 1
Job 7 25k 1
Job 8 55k 2
Job 9 88k 3
Job 10 100k 3

You might also like