LIVE Course for free

Rated by 1 million+ students
Get app now
JEE MAIN 2024
JEE MAIN 2025 Foundation Course
NEET 2024 Crash Course
NEET 2025 Foundation Course
CLASS 12 FOUNDATION COURSE
CLASS 10 FOUNDATION COURSE
CLASS 9 FOUNDATION COURSE
CLASS 8 FOUNDATION COURSE
0 votes
249 views
in Computer by (72.5k 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 (121k 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

...