6
$\begingroup$

For the following jobs:

job table

The average wait time would be using a FCFS algorithm:

(6-6)+(7-2)+(11-5)+(17-5)+(14-1) -> 0+5+6+10+13 -> 34/5 = 7 (6.8)

What would the average turnaround time be?

$\endgroup$
  • 2
    $\begingroup$ How does the exercise source define "turnaround" time? What methods have you tried? $\endgroup$ – Raphael Apr 14 '12 at 16:00
  • $\begingroup$ Turnaround Time = Completion Time - Arrival Time. Although I have checked the solutions and the answer given was: 6+8+13+20+21= 68/5 = 13.6 Is that the correct answer? $\endgroup$ – Sheldon Apr 14 '12 at 16:18
8
$\begingroup$

You need to determine at what time each job is completed. With a first-come-first-served scheduler, this is simple to calculate: each job starts as soon as the processor becomes free, and takes exactly its burst time to complete. You've already calculated the start and end times to calculate the wait times, so use that to obtain the turnaround time.

For example, A arrives at time 0. The processor is free, so it starts at time 0 and ends at time 6. Then the processor runs B, which had to wait for 5 units, and finishes at time 8, for a turnaround time of 7.

The answer from the book seems to be totaling the completion times, without regard for the arrival time. This is not something I recognize as “turnaround time”.

$\endgroup$
  • $\begingroup$ Do the "turnaround time" formula (Finish Time - Arrival Time) is same for both pre-emptive and non-pre-emptive algorithms? $\endgroup$ – Omar Tariq Nov 18 '15 at 0:20
  • 1
    $\begingroup$ @OmarTariq I don't see what connection scheduler preemptivity (i.e. whether task switching is performed when the program wants or when the kernel wants) could possibly have with completion times. In the example of this question, there's no preemption (no task switching) at all anyway. $\endgroup$ – Gilles 'SO- stop being evil' Nov 18 '15 at 0:33
1
$\begingroup$

the turnaround time is TAT= Completion time-arrival time for A=6-0 B=8-1 C=13-2 D=20-3 E=21-7 that gives 6+7+11+17+14/5=11

so average TAT=11

$\endgroup$
  • 2
    $\begingroup$ Hi and welcome to CS Stack Exchange! Our goal is to build up a repository of high-quality questions and answers, and a good answer explains why it's the answer, rather than just giving a bunch of equations. You can click the edit button to improve your answer. $\endgroup$ – David Richerby Feb 27 '14 at 10:39
1
$\begingroup$

In textbooks, the solution given is 6+8+13+20+21= 68/5 = 13.6 This is because the textbooks (including Operating System Concepts 8e by Silberschatz,Gagne,Gelvin) define turnaround time as the time that elapses between the submission and the termination of the process, which is the sum of arrival time, waiting time, execution time and time spent in device queues. Since in this problem we are considering FCFS scheduling, the termination instant for processes are 6,8,13,20,21 starting from the time of submission . Taking their average gives the answer at the back of the textbook. I think that this terminology goes back to the batch systems where all the "jobs" were submitted at the same time as a batch. The arrival time refers to the time it takes for a process to be created and brought into the Main Memory from the job pool after submission. Drawing a Gantt Chart would make it easier to calculate the various times according to various definitions.

New contributor
orangemonkey is a new contributor to this site. Take care in asking for clarification, commenting, and answering. Check out our Code of Conduct.
$\endgroup$
0
$\begingroup$

As already said the Tournaround time (TAT) is the time between submission and completion. If we look at the tasks:

A arrives at time 0 (submission time) and takes 6 timeunits to finish. that means the TAT of A is 6.

lets look at task B it arrives at time 1. but it has to wait for A to finish. A finishes at 6 and then B starts working and finishes at 8. Now we subtract the arrival time minus finishing time 8-1=7 which is the TAT.

Now C--> arrival time 2; working time (burst) 5 ;finishing time:13 --> Tat 13-2=11

Now D--> arrival time 3; working time (burst) 7 ;finishing time:20 --> Tat 20-3=17

Now E--> arrival time 7; working time (burst) 1 ;finishing time:21 --> Tat 21-7=14

now the result-->(6+7+11+17+14)/5=11

!tada!

$\endgroup$
0
$\begingroup$

EXECUTION TIME-ARRIVAL TIME=TURN AROUND TIME AND THEN THE EXECUTION ADDS TO THE NEXT EXECUTION TO THE ALREADY EXISTING TIME TO SUBTRACT THE ARRIVAL TIME . THEN ADD ALL THE TURNAROUND TIME AND THE DIVIDE THERE SUM TOTAL BY THERE TOTAL NUMBER

$\endgroup$
  • 1
    $\begingroup$ Welcome to the site! Be aware that all-caps messages are (1) hard to read, and (2) often considered as shouting. Better to avoid such things. $\endgroup$ – Rick Decker Nov 18 '15 at 1:14
  • 1
    $\begingroup$ Also, the answer would probably be better if it included some explanation of why this procedure works and how to apply it to this particular problem (rather than just providing the formula, without justification). $\endgroup$ – D.W. Nov 18 '15 at 2:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.