LIVE Course for free

Rated by 1 million+ students
Get app now
JEE MAIN 2023
JEE MAIN 2023 TEST SERIES
NEET 2023 TEST SERIES
NEET 2023
CLASS 12 FOUNDATION COURSE
CLASS 10 FOUNDATION COURSE
CLASS 9 FOUNDATION COURSE
CLASS 8 FOUNDATION COURSE
0 votes
193 views
in Computer by (24.3k points)
closed by

An operating system uses shortest remaining time (SRT) scheduling algorithm. Consider the arrival times and execution time for the following processes:

Proces Arrival Time Execution Time
P1 0 20
P2 15 25
P3 30 10
P4 45 15

What is total waiting time for process P2?


1. 5
2. 15
3. 40
4. 55

1 Answer

0 votes
by (24.2k points)
selected by
 
Best answer
Correct Answer - Option 2 : 15

Shortest remaining time (SRT)  is pre-emptive algorithms

Gantt chart:

P1

P2

P3

P2

  P4

0      20      30      40     55      70

Process Table:

Process

Arrival Time

Execution Time (Burst Time)

Completion Time  Turnaround time  Waiting time

P1

0

20

     

P2

15

25

55 40 15

P3

30

10

     

P4

45

15

     
 

Explanation:

Completion time For P2 =55

Turn around time (TAT) = Completion time - Arrival time = 55 -15 = 40

Waiting Time for P2  = TAT-Execution Time = 40- 25 =15

Therefore waiting time P2 is 15 unit:

Welcome to Sarthaks eConnect: A unique platform where students can interact with teachers/experts/students to get solutions to their queries. Students (upto class 10+2) preparing for All Government Exams, CBSE Board Exam, ICSE Board Exam, State Board Exam, JEE (Mains+Advance) and NEET can ask questions from any subject and get quick answers by subject teachers/ experts/mentors/students.

Categories

...