Search code examples
schedulingfifo

How to calculate average turnaround time - Round Robin and FIFO scheduling?


Five processes begins with their execution at (0, 0, 2, 3, 3) seconds and execute for (2, 2, 1, 2, 2) seconds. How do I calculate average turnaround time if:

a) We use Round Robin (quantum 1 sec.)

b) We use FIFO scheduling?

I am not sure how to solve this, could you guys help me out?

Here is the link of .png table;

table link


Solution

  • I suppose that your exercise is about scheduling tasks on a single processor. My understanding is hence the following:

    • With FIFO, each task is scheduled in order of arrival and is executed until it's completed
    • With RR, earch tasks scheduled is executed for a quantum of time only, sharing the processor between all active processes.

    In this case you obtain such a scheduling table:

    enter image description here

    The turnaround is the time between the time the job is submitted, and the time it is ended. In first case, I find 19 in total thus 3.8 in average. In the second case, I find 25 in total and 5 on average.

    On your first try, you have processes running in parallel. This would assume 2 processors. But if 2 processors are available, the round robin and the FIFO would have the same result, as there are always enough processors for serving the active processes (thus no waiting time). The total turnaround would be 9 and the average 1,8.