Gantt Chart, Turnaround Time, Waiting Time, Average Turnaround Time and Average Waiting Time

Q2. Let’s take three processes that arrive at the same time in this order:

Process     CPU Time Needed (ms)

P1               24

P2             3

P3               3

The processes are assumed to have arrived in order P1, P2 and P3, all at time 0.

Draw Gantt Chart, calculate Turnaround Time, Waiting Time, Average Turnaround Time and Average Waiting Time.

Ans. P1 starts at time 0 and ends at time 24.

P2 starts at time 24 and ends at time 27.

P3 starts at time 27 and ends at time 30.

Thus, P2 has to wait 24 milliseconds to start and P3 has to wait 27 milliseconds. The average waiting time here is:

Gantt Chart:

P1 P2 P3

0                                                                 24                                  27                               30

 

P1’s waiting time=0

P2’s waiting time=24

P3’s waiting time=27

Average waiting time is the sum of waiting times of all the processes divided by number of processes.

Average Waiting Time

=(0+24+27)/3

=51/3

=17milliseconds

Turnaround Time

It is computed by subtracting the time the process entered the system from the time it terminated. Therefore we can say that:

Turnaround Time = Burst Time + Waiting Time

Process             Turnaround Time

P1                       24+0=24

P2                       3+24=27

P3                       3+27=30

Average Turnaround Time

=(24+27+30)/3

=81/3

27 milliseconds

Advertisements

One thought on “Gantt Chart, Turnaround Time, Waiting Time, Average Turnaround Time and Average Waiting Time

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s