Shortest Remaining Time SRT Process Arrival Time Service

  • Slides: 15
Download presentation
Shortest Remaining Time (SRT) Process Arrival Time Service Time A B C D E

Shortest Remaining Time (SRT) Process Arrival Time Service Time A B C D E 0 2 4 6 8 3 6 4 5 2 Shortest Remaining Time SRT Execution Waiting Processes Exit Process with the shortes remaining time is chosen Prepared by Ahmet Rizaner 1

Shortest Remaining Time (SRT) Process Arrival Time Service Time A B C D E

Shortest Remaining Time (SRT) Process Arrival Time Service Time A B C D E 0 2 4 6 8 3 6 4 5 2 Time = 0 Execution Waiting Processes A Exit Process with the shortes remaining time is chosen 2

Shortest Remaining Time (SRT) Process Arrival Time Service Time A B C D E

Shortest Remaining Time (SRT) Process Arrival Time Service Time A B C D E 0 2 4 6 8 3 6 4 5 2 Time = 1 Execution Waiting Processes A Exit Process with the shortes remaining time is chosen 3

Shortest Remaining Time (SRT) Process Arrival Time Service Time A B C D E

Shortest Remaining Time (SRT) Process Arrival Time Service Time A B C D E 0 2 4 6 8 3 6 4 5 2 Remaining times: A 1 B 6 So, A will continue Time = 2 Execution Waiting Processes B A Exit Process with the shortes remaining time is chosen 4

Shortest Remaining Time (SRT) Process Arrival Time Service Time A B C D E

Shortest Remaining Time (SRT) Process Arrival Time Service Time A B C D E 0 2 4 6 8 3 6 4 5 2 Time = 3 Execution Waiting Processes B A Exit Process with the shortes remaining time is chosen 5

Shortest Remaining Time (SRT) Process Arrival Time Service Time A B C D E

Shortest Remaining Time (SRT) Process Arrival Time Service Time A B C D E 0 2 4 6 8 3 6 4 5 2 Remaining times: B 5 C 4 So, B goes to waiting state And C to running state Time = 4 Execution Waiting Processes C B Exit Process with the shortes remaining time is chosen 6

Shortest Remaining Time (SRT) Process Arrival Time Service Time A B C D E

Shortest Remaining Time (SRT) Process Arrival Time Service Time A B C D E 0 2 4 6 8 3 6 4 5 2 Time = 5 Execution Waiting Processes B C Exit Process with the shortes remaining time is chosen 7

Shortest Remaining Time (SRT) Process Arrival Time Service Time A B C D E

Shortest Remaining Time (SRT) Process Arrival Time Service Time A B C D E 0 2 4 6 8 3 6 4 5 2 Remaining times: B 5 C 2 D 5 So, C will continue. Time = 6 Execution Waiting Processes D B C Exit Process with the shortes remaining time is chosen 8

Shortest Remaining Time (SRT) Process Arrival Time Service Time A B C D E

Shortest Remaining Time (SRT) Process Arrival Time Service Time A B C D E 0 2 4 6 8 3 6 4 5 2 Time = 7 Execution Waiting Processes D B C Exit Process with the shortes remaining time is chosen 9

Shortest Remaining Time (SRT) Process Arrival Time Service Time A B C D E

Shortest Remaining Time (SRT) Process Arrival Time Service Time A B C D E 0 2 4 6 8 3 6 4 5 2 Remaining times: B 5 D 5 E 2 So, E is next. Time = 8 Execution Waiting Processes E D B C Exit Process with the shortes remaining time is chosen 10

Shortest Remaining Time (SRT) Process Arrival Time Service Time A B C D E

Shortest Remaining Time (SRT) Process Arrival Time Service Time A B C D E 0 2 4 6 8 3 6 4 5 2 Time = 10 Execution Waiting Processes D B E Exit Process with the shortes remaining time is chosen 11

Shortest Remaining Time (SRT) Process Arrival Time Service Time A B C D E

Shortest Remaining Time (SRT) Process Arrival Time Service Time A B C D E 0 2 4 6 8 3 6 4 5 2 Remaining times: B 5 D 5 In such cases, chose the first started process. (process with the smallest arrival time) Time = 10 Execution Waiting Processes D B Exit Process with the shortes remaining time is chosen 12

Shortest Remaining Time (SRT) Process Arrival Time Service Time A B C D E

Shortest Remaining Time (SRT) Process Arrival Time Service Time A B C D E 0 2 4 6 8 3 6 4 5 2 Time = 15 Execution Waiting Processes D B Exit Process with the shortes remaining time is chosen 13

Shortest Remaining Time (SRT) Process Arrival Time Service Time A B C D E

Shortest Remaining Time (SRT) Process Arrival Time Service Time A B C D E 0 2 4 6 8 3 6 4 5 2 Time = 20 Execution Waiting Processes D Exit Process with the shortes remaining time is chosen 14

Shortest Remaining Time (SRT) Process Arrival Time Service Time A B C D E

Shortest Remaining Time (SRT) Process Arrival Time Service Time A B C D E 0 2 4 6 8 3 6 4 5 2 Execution Waiting Processes Exit Process with the shortes remaining time is chosen Prepared by Ahmet Rizaner 15