When we start learning about CPU scheduling algorithms, we come across some terms that are very confusing. This includes terms like arrival time, burst time, completion time, turnaround time, waiting time, and response time.
These calculations judge the efficiency of a scheduling algorithm. You can find their definitions and examples below.
The arrival time of a process is when a process is ready to be executed, which means it is finally in a ready state and is waiting in a queue for its turn to be executed.
Each process has a pre-determined arrival and burst time, as highlighted in the table below. The arrival time for processes 1, 2, 3, and 4 is 0, 0, 3, and 5 seconds respectively.
The burst time of a process is the number of time units it requires to be executed by the CPU. In the table below, the burst time is also written for each of the four processes.
The completion time is the time when the process stops executing, which means that the process has completed its burst time and is completely executed.
The exit time is when a process has been fully executed and permanently leaves the waiting queue.
Turnaround time is the duration between the arrival of a process into the waiting queue until it exits the waiting queue completely. To calculate the turnaround time for a process, we can use two formulas:
OR:
To understand turnaround time better, we can use the table above. If we use the Robin Hood scheduling method and keep the
P1: 3 + 0 = 3 seconds
P2: 4 + 9 = 13 seconds
P3: 4 + 7 = 11 seconds
P4: 4 + 6 = 10 seconds
The waiting time of a process is the time it waits between its arrival in a waiting queue and the time it is fully executed. Hence, waiting time is:
Using the example similar to turnaround time, we can calculate the waiting time for each of the processes.
P1: 0 seconds
P2: 9 seconds
P3: 7 seconds
P4: 6 seconds
The response time is the duration between a process’s arrival into the waiting queue and when it gets the CPU for the first time.
Using the example similar to turnaround time, we can calculate the response time for each of the processes.
P1: 0 seconds
P2: 3 seconds
P3: 3 seconds
P4: 4 seconds
Free Resources
Copyright ©2024 Educative, Inc. All rights reserved.