edited by
8,133 views
24 votes
24 votes

An operating system used Shortest Remaining System Time first (SRT) process scheduling algorithm. Consider the arrival times and execution times for the following processes:$$\small \begin{array}{|c|c|c|} \hline \textbf{Process} &  \textbf{Execution Time} & \textbf{Arrival Time} \\\hline \text{P1} & 20 & 0 \\ \text{P2} & 25 & 15 \\ \text{P3} & 10 & 30 \\ \text{P4} & 15 & 45 \\\hline  \end{array}$$What is the total waiting time for process $P2$ ?

  1. $5$
  2. $15$
  3. $40$
  4. $55$
edited by

4 Answers

Best answer
28 votes
28 votes

The answer is (B).

Gantt Chart
Gantt Chart

Waiting time for process $P2 =$ Completion time $–$ Arrival time $–$ burst time $= 55 – 15 – 25 = 15$

edited by
15 votes
15 votes

For process $P2$ :
$\begin{align*} \text{Waiting Time} &= \text{TAT} - \text{BT}\\ &= \left ( \text{CT-AT}\right) - BT \\ &= \left( 55 - 15 \right ) - 25 \\ &= 15 \end{align*}$

answer = option B

3 votes
3 votes

we can solve using this way 

Answer:

Related questions

37 votes
37 votes
2 answers
1
Kathleen asked Sep 21, 2014
9,706 views
Group 1 contains some CPU scheduling algorithms and Group 2 contains some applications. Match entries in Group 1 to entries in Group 2.$$\begin{array}{|ll|ll|} \hline \rl...
16 votes
16 votes
4 answers
2
go_editor asked Apr 23, 2016
6,506 views
A process, has been allocated $3$ page frames. Assume that none of the pages of the process are available in the memory initially. The process makes the following sequenc...