ALL > Computer and Education > courses > university courses > undergraduate courses > Operating System > zstu-(2021-2022)-1 >
homework 3 PATIENCE FERO 2019529628044 Version 0
👤 Author: by feropatienceoutlookcom 2021-12-28 09:24:20
Scheduling of processes/work is done to finish the work on time.

Below are different time with respect to a process

Burst time


Every process in a computer system requires some amount of time for its execution. This time is both the CPU time and the I/O time. The CPU time is the time taken by CPU to execute the process. While the I/O time is the time taken by the process to perform some I/O operation. In general, we ignore the I/O time and we consider only the CPU time for a process. So, Burst time is the total time taken by the process for its execution on the CPU.



Arrival time


Arrival time is the time when a process enters into the ready state and is ready for its execution.




Here in the above example, the arrival time of all the 3 processes are 0 ms, 1 ms, and 2 ms respectively.



Exit time


Exit time is the time when a process completes its execution and exit from the system.



Response time


Response time is the time spent when the process is in the ready state and gets the CPU for the first time. For example, here we are using the First Come First Serve CPU scheduling algorithm for the below 3 processes:




Here, the response time of all the 3 processes are:




  • P1: 0 ms

  • P2: 7 ms because the process P2 have to wait for 8 ms during the execution of P1 and then after it will get the CPU for the first time. Also, the arrival time of P2 is 1 ms. So, the response time will be 8-1 = 7 ms.

  • P3: 13 ms because the process P3 have to wait for the execution of P1 and P2 i.e. after 8+7 = 15 ms, the CPU will be allocated to the process P3 for the first time. Also, the arrival of P3 is 2 ms. So, the response time for P3 will be 15-2 = 13 ms.


Response time = Time at which the process gets the CPU for the first time - Arrival time


 

Waiting time


Waiting time is the total time spent by the process in the ready state waiting for CPU. For example, consider the arrival time of all the below 3 processes to be 0 ms, 0 ms, and 2 ms and we are using the First Come First Serve scheduling algorithm.




Then the waiting time for all the 3 processes will be:




  • P1: 0 ms

  • P2: 8 ms because P2 have to wait for the complete execution of P1 and arrival time of P2 is 0 ms.

  • P3: 13 ms becuase P3 will be executed after P1 and P2 i.e. after 8+7 = 15 ms and the arrival time of P3 is 2 ms. So, the waiting time of P3 will be: 15-2 = 13 ms.


Waiting time = Turnaround time - Burst time


In the above example, the processes have to wait only once. But in many other scheduling algorithms, the CPU may be allocated to the process for some time and then the process will be moved to the waiting state and again after some time, the process will get the CPU and so on.



 CPU-I/O Burst Cycle



  • Almost all processes alternate between two states in a continuing cycle, as shown in Figure 6.1 below :

    • A CPU burst of performing calculations, and

    • An I/O burst, waiting for data transfer in or out of the system.




Please login to reply. Login

Reversion History

Loading...
No reversions found.