in Operating System
518 views
0 votes
0 votes
What is the response time of a process? I mean how to calculate or how to know the response time of a process in numerical.
in Operating System
518 views

1 Answer

3 votes
3 votes
Best answer

Response time is the time at which CPU responds to a process for the first time, In other words response time is the time difference between the time when a process got scheduled for first time to its arrival time.

Response time =  First scheduled time  - Arrival time

While solving problems if we are supposed to find response time of only $1$ process, say P1 ,then its better to draw Gantt Chart and see directly when the process P1 got scheduled for the first time and then subtract its arrival time to get response time.( pretty easy and time saving).

But on the other hand if we are required to find out average response time, then same thing can be done for all $n$ processes and then finding their average ( but it may seem a bit difficult at first ). Follow tabular method i.e., write everything in tabular way and approach is same ( this will take some time but will reduce the chances of minor calculation mistakes)

Hope it helps you :)

selected by

4 Comments

then this is the wrong solution?

0
0
Yes, this is wrong solution.

Correct would be $\frac{0+10+36+38+80}{5}$
2
2
How can we say that  a process respond as soon as it starts its excution.
0
0

See the Gantt chart in above solution, the process P1 starts its execution at $t = 0$ and completes at $t = 10$.
So, process P1 arrived at $t=0$ and responsed at $t=0$. So response time = $0$

1
1