BCA 4th sem
Home/BCA 4th sem BCA 4th sem

9. What is CPU Scheduling? Write does the criteria for CPU scheduling? Consider the following set of processes, with the length of the CPU burst given in millisecond , draw Gant chart illustrating their execution and calculate average waiting time using:

a) First come First serve

b) Shortest Job first

c) None-preemptive priority (smaller number implies higher priority)

d) Round robin (quantum=1)

## BCA 4th semester long question solution 2078

a)  First Come First Serve

Solution

Note:- CT=From Gantt chart

TAT= CT-AT

WT=TAT-BT

P0=This process come first so we start at first AT=0 here in BT= 10

P1= P0 को BT लाई P1मा जोडनु पार्ने हुन्छ । Eg, [ P0 Burst time (BT)=10+P1(1)=11]

Gantt chart

Total Waiting Time= 0+10+11+13+14

=48

Average waiting time=Total waiting time/ process

48/6

=9.6

Total turn around Time= 10+11+13+14+19

=67

Average turn around time= Total turn around time/ Process

= 67/5

= 13.4

b) Short job first

Solution

Total waiting Time=0+10+12+11+10

=43

Average waiting time= Total waiting time/process

=43/5

=8.6

Total turnaround time= 10+11+14+12+15

=62

Average turn around time= total trunaround time/Process

=62/5

=12.4

C) Non-preemptive priority (small number implies higher)

Total waiting Time=0+10+17+16+11

=54

Average waiting time= Total waiting time/process

=54/5

=10.8

Total turnaround time= 10+11+19+17+16

=73

Total turn around time= total trunaround time/Process

=73/5

=14.6

d) Round Robin (quantum = 1)

Total waiting Time=0+10+13+12+15

=50

Average waiting time= Total waiting time/process

=50/5

=10

Total turnaround time= 10+11+15+13+19

=68

Total turn around time= total trunaround time/Process

=68/5

=13.6

BCA 4th semester long question solution 2078

BCA 4th sem BCA 4th sem BCA 4th sem

error: Content is protected !!!