0% found this document useful (0 votes)
30 views78 pages

First-Come, First-Served (FIFO) : Start Jobs in The Order They Arrive (FIFO Queue) Run Each Job Until Completion

The document describes three scheduling algorithms: First-Come, First-Served (FIFO) which processes jobs in the order they arrive without preemption; Shortest Job First which selects the job with the shortest processing time without preemption; and Shortest Remaining Time which is a preemptive version of Shortest Job First that always selects the job with the shortest remaining processing time first.
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
30 views78 pages

First-Come, First-Served (FIFO) : Start Jobs in The Order They Arrive (FIFO Queue) Run Each Job Until Completion

The document describes three scheduling algorithms: First-Come, First-Served (FIFO) which processes jobs in the order they arrive without preemption; Shortest Job First which selects the job with the shortest processing time without preemption; and Shortest Remaining Time which is a preemptive version of Shortest Job First that always selects the job with the shortest remaining processing time first.
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 78

First-Come, First-Served (FIFO)

Start jobs in the order they arrive (FIFO queue) Run each job until completion
Process 1 2 3 4 5 Arrival Time 0 2 4 6 8 Processing Time 3 6 4 5 2

First-Come, First-Served (FIFO)


Start jobs in the order they arrive (FIFO queue) Run each job until completion
Process 1 2 3 4 5 Arrival Time 0 2 4 6 8 Processing Time 3 6 4 5 2 Delay
Total time taken, from submission to completion

Turnaround Time

First-Come, First-Served (FIFO)


Start jobs in the order they arrive (FIFO queue) Run each job until completion
Process 1 2 3 4 5 Arrival Time 0 2 4 6 8 Processing Time 3 6 4 5 2 Delay
Total time taken, from submission to completion

Turnaround Time

Arrival Times of the Jobs

10

15

20

First-Come, First-Served (FIFO)


Start jobs in the order they arrive (FIFO queue) Run each job until completion
Process 1 2 3 4 5 Arrival Time 0 2 4 6 8 Processing Time 3 6 4 5 2 Delay
Total time taken, from submission to completion

Turnaround Time

10

15

20

10

First-Come, First-Served (FIFO)


Start jobs in the order they arrive (FIFO queue) Run each job until completion
Process 1 2 3 4 5 Arrival Time 0 2 4 6 8 Processing Time 3 6 4 5 2 Delay
Total time taken, from submission to completion

Turnaround Time

10

15

20

11

First-Come, First-Served (FIFO)


Start jobs in the order they arrive (FIFO queue) Run each job until completion
Process 1 2 3 4 5 Arrival Time 0 2 4 6 8 Processing Time 3 6 4 5 2 Delay
Total time taken, from submission to completion

Turnaround Time

10

15

20

12

First-Come, First-Served (FIFO)


Start jobs in the order they arrive (FIFO queue) Run each job until completion
Process 1 2 3 4 5 Arrival Time 0 2 4 6 8 Processing Time 3 6 4 5 2 Delay
Total time taken, from submission to completion

Turnaround Time

10

15

20

13

First-Come, First-Served (FIFO)


Start jobs in the order they arrive (FIFO queue) Run each job until completion
Process 1 2 3 4 5 Arrival Time 0 2 4 6 8 Processing Time 3 6 4 5 2 Delay
Total time taken, from submission to completion

Turnaround Time

10

15

20

14

First-Come, First-Served (FIFO)


Start jobs in the order they arrive (FIFO queue) Run each job until completion
Process 1 2 3 4 5 Arrival Time 0 2 4 6 8 Processing Time 3 6 4 5 2 Delay
Total time taken, from submission to completion

Turnaround Time

10

15

20

15

First-Come, First-Served (FIFO)


Start jobs in the order they arrive (FIFO queue) Run each job until completion
Process 1 2 3 4 5 Arrival Time 0 2 4 6 8 Processing Time 3 6 4 5 2 Delay
Total time taken, from submission to completion

Turnaround Time

10

15

20

16

First-Come, First-Served (FIFO)


Start jobs in the order they arrive (FIFO queue) Run each job until completion
Process 1 2 3 4 5 Arrival Time 0 2 4 6 8 Processing Time 3 6 4 5 2 Delay
Total time taken, from submission to completion

Turnaround Time

10

15

20

17

First-Come, First-Served (FIFO)


Start jobs in the order they arrive (FIFO queue) Run each job until completion
Process 1 2 3 4 5 Arrival Time 0 2 4 6 8 Processing Time 3 6 4 5 2 Delay
Total time taken, from submission to completion

Turnaround Time

10

15

20

18

First-Come, First-Served (FIFO)


Start jobs in the order they arrive (FIFO queue) Run each job until completion
Process 1 2 3 4 5 Arrival Time 0 2 4 6 8 Processing Time 3 6 4 5 2 Delay
Total time taken, from submission to completion

Turnaround Time

10

15

20

19

First-Come, First-Served (FIFO)


Start jobs in the order they arrive (FIFO queue) Run each job until completion
Process 1 2 3 4 5 Arrival Time 0 2 4 6 8 Processing Time 3 6 4 5 2 Delay
Total time taken, from submission to completion

Turnaround Time

10

15

20

20

First-Come, First-Served (FIFO)


Start jobs in the order they arrive (FIFO queue) Run each job until completion
Process 1 2 3 4 5 Arrival Time 0 2 4 6 8 Processing Time 3 6 4 5 2 Delay
Total time taken, from submission to completion

Turnaround Time

10

15

20

21

First-Come, First-Served (FIFO)


Start jobs in the order they arrive (FIFO queue) Run each job until completion
Process 1 2 3 4 5 Arrival Time 0 2 4 6 8 Processing Time 3 6 4 5 2 Delay 0 1 5 7 10
Total time taken, from submission to completion

Turnaround Time

10

15

20

22

First-Come, First-Served (FIFO)


Start jobs in the order they arrive (FIFO queue) Run each job until completion
Process 1 2 3 4 5 Arrival Time 0 2 4 6 8 Processing Time 3 6 4 5 2 Delay 0 1 5 7 10
Total time taken, from submission to completion

Turnaround Time 3 7 9 12 12

10

15

20

23

Shortest Job First


Select the job with the shortest (expected) running time Non-Preemptive

24

Shortest Job First


Select the job with the shortest (expected) running time Non-Preemptive
Process 1 2 3 4 5 Arrival Time 0 2 4 6 8 Processing Time 3 6 4 5 2 Delay Turnaround Time

Same Job Mix

10

15

20

25

Shortest Job First


Select the job with the shortest (expected) running time Non-Preemptive
Process 1 2 3 4 5 Arrival Time 0 2 4 6 8 Processing Time 3 6 4 5 2 Delay Turnaround Time

10

15

20

26

Shortest Job First


Select the job with the shortest (expected) running time Non-Preemptive
Process 1 2 3 4 5 Arrival Time 0 2 4 6 8 Processing Time 3 6 4 5 2 Delay Turnaround Time

10

15

20

27

Shortest Job First


Select the job with the shortest (expected) running time Non-Preemptive
Process 1 2 3 4 5 Arrival Time 0 2 4 6 8 Processing Time 3 6 4 5 2 Delay Turnaround Time

10

15

20

28

Shortest Job First


Select the job with the shortest (expected) running time Non-Preemptive
Process 1 2 3 4 5 Arrival Time 0 2 4 6 8 Processing Time 3 6 4 5 2 Delay Turnaround Time

10

15

20

29

Shortest Job First


Select the job with the shortest (expected) running time Non-Preemptive
Process 1 2 3 4 5 Arrival Time 0 2 4 6 8 Processing Time 3 6 4 5 2 Delay Turnaround Time

10

15

20

30

Shortest Job First


Select the job with the shortest (expected) running time Non-Preemptive
Process 1 2 3 4 5 Arrival Time 0 2 4 6 8 Processing Time 3 6 4 5 2 Delay Turnaround Time

10

15

20

31

Shortest Job First


Select the job with the shortest (expected) running time Non-Preemptive
Process 1 2 3 4 5 Arrival Time 0 2 4 6 8 Processing Time 3 6 4 5 2 Delay Turnaround Time

10

15

20

32

Shortest Job First


Select the job with the shortest (expected) running time Non-Preemptive
Process 1 2 3 4 5 Arrival Time 0 2 4 6 8 Processing Time 3 6 4 5 2 Delay Turnaround Time

10

15

20

33

Shortest Job First


Select the job with the shortest (expected) running time Non-Preemptive
Process 1 2 3 4 5 Arrival Time 0 2 4 6 8 Processing Time 3 6 4 5 2 Delay Turnaround Time

10

15

20

34

Shortest Job First


Select the job with the shortest (expected) running time Non-Preemptive
Process 1 2 3 4 5 Arrival Time 0 2 4 6 8 Processing Time 3 6 4 5 2 Delay Turnaround Time

10

15

20

35

Shortest Job First


Select the job with the shortest (expected) running time Non-Preemptive
Process 1 2 3 4 5 Arrival Time 0 2 4 6 8 Processing Time 3 6 4 5 2 Delay Turnaround Time

10

15

20

36

Shortest Job First


Select the job with the shortest (expected) running time Non-Preemptive
Process 1 2 3 4 5 Arrival Time 0 2 4 6 8 Processing Time 3 6 4 5 2 Delay Turnaround Time

10

15

20

37

Shortest Job First


Select the job with the shortest (expected) running time Non-Preemptive
Process 1 2 3 4 5 Arrival Time 0 2 4 6 8 Processing Time 3 6 4 5 2 Delay 0 1 7 9 1 Turnaround Time

10

15

20

38

Shortest Job First


Select the job with the shortest (expected) running time Non-Preemptive
Process 1 2 3 4 5 Arrival Time 0 2 4 6 8 Processing Time 3 6 4 5 2 Delay 0 1 7 9 1 Turnaround Time 3 7 11 14 3

10

15

20

39

Shortest Remaining Time


Preemptive version of SJF
Arrival Time 0 2 4 6 8 Processing Time 3 6 4 5 2 Turnaround Time

Process 1 2 3 4 5

Delay

Same Job Mix

10

15

20

40

Shortest Remaining Time


Preemptive version of SJF
Arrival Time 0 2 4 6 8 Processing Time 3 6 4 5 2 Turnaround Time

Process 1 2 3 4 5

Delay

10

15

20

41

Shortest Remaining Time


Preemptive version of SJF
Arrival Time 0 2 4 6 8 Processing Time 3 6 4 5 2 Turnaround Time

Process 1 2 3 4 5

Delay

10

15

20

42

Shortest Remaining Time


Preemptive version of SJF
Arrival Time 0 2 4 6 8 Processing Time 3 6 4 5 2 Turnaround Time

Process 1 2 3 4 5

Delay

10

15

20

43

Shortest Remaining Time


Preemptive version of SJF
Arrival Time 0 2 4 6 8 Processing Time 3 6 4 5 2 Turnaround Time

Process 1 2 3 4 5

Delay

10

15

20

44

Shortest Remaining Time


Preemptive version of SJF
Arrival Time 0 2 4 6 8 Processing Time 3 6 4 5 2 Turnaround Time

Process 1 2 3 4 5

Delay

10

15

20

45

Shortest Remaining Time


Preemptive version of SJF
Arrival Time 0 2 4 6 8 Processing Time 3 6 4 5 2 Turnaround Time

Process 1 2 3 4 5

Delay

10

15

20

46

Shortest Remaining Time


Preemptive version of SJF
Arrival Time 0 2 4 6 8 Processing Time 3 6 4 5 2 Turnaround Time

Process 1 2 3 4 5

Delay

10

15

20

47

Shortest Remaining Time


Preemptive version of SJF
Arrival Time 0 2 4 6 8 Processing Time 3 6 4 5 2 Turnaround Time

Process 1 2 3 4 5

Delay

10

15

20

48

Shortest Remaining Time


Preemptive version of SJF
Arrival Time 0 2 4 6 8 Processing Time 3 6 4 5 2 Turnaround Time

Process 1 2 3 4 5

Delay

10

15

20

49

Shortest Remaining Time


Preemptive version of SJF
Arrival Time 0 2 4 6 8 Processing Time 3 6 4 5 2 Turnaround Time

Process 1 2 3 4 5

Delay

10

15

20

50

Shortest Remaining Time


Preemptive version of SJF
Arrival Time 0 2 4 6 8 Processing Time 3 6 4 5 2 Turnaround Time

Process 1 2 3 4 5

Delay

10

15

20

51

Shortest Remaining Time


Preemptive version of SJF
Arrival Time 0 2 4 6 8 Processing Time 3 6 4 5 2 Turnaround Time

Process 1 2 3 4 5

Delay

10

15

20

52

Shortest Remaining Time


Preemptive version of SJF
Arrival Time 0 2 4 6 8 Processing Time 3 6 4 5 2 Turnaround Time

Process 1 2 3 4 5

Delay

10

15

20

53

Shortest Remaining Time


Preemptive version of SJF
Arrival Time 0 2 4 6 8 Processing Time 3 6 4 5 2 Turnaround Time

Process 1 2 3 4 5

Delay 0 7 0 9 0

10

15

20

54

Shortest Remaining Time


Preemptive version of SJF
Arrival Time 0 2 4 6 8 Processing Time 3 6 4 5 2 Turnaround Time 3 13 4 14 2

Process 1 2 3 4 5

Delay 0 7 0 9 0

10

15

20

55

Round-Robin Scheduling
Goal: Enable interactivity
Limit the amount of CPU that a process can have at one time.

Time quantum
Amount of time the OS gives a process before intervention The time slice Typically: 1 to 100ms

56

Round-Robin Scheduling

Process 1 2 3 4 5 Arrival Time 0 2 4 6 8 Processing Time 3 6 4 5 2

10

15

20
57

Round-Robin Scheduling

Process 1 2 3 4 5 Arrival Time 0 2 4 6 8 Processing Time 3 6 4 5 2 Ready List:

10

15

20
58

Round-Robin Scheduling

Process 1 2 3 4 5 Arrival Time 0 2 4 6 8 Processing Time 3 6 4 5 2 Ready List:

10

15

20
59

Round-Robin Scheduling

Process 1 2 3 4 5 Arrival Time 0 2 4 6 8 Processing Time 3 6 4 5 2 Ready List:

10

15

20
60

Round-Robin Scheduling

Process 1 2 3 4 5 Arrival Time 0 2 4 6 8 Processing Time 3 6 4 5 2 Ready List:

10

15

20
61

Round-Robin Scheduling

Process 1 2 3 4 5 Arrival Time 0 2 4 6 8 Processing Time 3 6 4 5 2 Ready List:

10

15

20
62

Round-Robin Scheduling

Process 1 2 3 4 5 Arrival Time 0 2 4 6 8 Processing Time 3 6 4 5 2 Ready List:

10

15

20
63

Round-Robin Scheduling

Process 1 2 3 4 5 Arrival Time 0 2 4 6 8 Processing Time 3 6 4 5 2 Ready List:

10

15

20
64

Round-Robin Scheduling

Process 1 2 3 4 5 Arrival Time 0 2 4 6 8 Processing Time 3 6 4 5 2 Ready List:

10

15

20
65

Round-Robin Scheduling

Process 1 2 3 4 5 Arrival Time 0 2 4 6 8 Processing Time 3 6 4 5 2 Ready List:

10

15

20
66

Round-Robin Scheduling

Process 1 2 3 4 5 Arrival Time 0 2 4 6 8 Processing Time 3 6 4 5 2 Ready List:

10

15

20
67

Round-Robin Scheduling

Process 1 2 3 4 5 Arrival Time 0 2 4 6 8 Processing Time 3 6 4 5 2 Ready List:

10

15

20
68

Round-Robin Scheduling

Process 1 2 3 4 5 Arrival Time 0 2 4 6 8 Processing Time 3 6 4 5 2 Ready List:

10

15

20
69

Round-Robin Scheduling

Process 1 2 3 4 5 Arrival Time 0 2 4 6 8 Processing Time 3 6 4 5 2 Ready List:

10

15

20
70

Round-Robin Scheduling

Process 1 2 3 4 5 Arrival Time 0 2 4 6 8 Processing Time 3 6 4 5 2 Ready List:

10

15

20
71

Round-Robin Scheduling

Process 1 2 3 4 5 Arrival Time 0 2 4 6 8 Processing Time 3 6 4 5 2 Ready List:

10

15

20
72

Round-Robin Scheduling

Process 1 2 3 4 5 Arrival Time 0 2 4 6 8 Processing Time 3 6 4 5 2 Ready List:

10

15

20
73

Round-Robin Scheduling

Process 1 2 3 4 5 Arrival Time 0 2 4 6 8 Processing Time 3 6 4 5 2 Ready List:

10

15

20
74

Round-Robin Scheduling

Process 1 2 3 4 5 Arrival Time 0 2 4 6 8 Processing Time 3 6 4 5 2 Ready List:

10

15

20
75

Round-Robin Scheduling

Process 1 2 3 4 5 Arrival Time 0 2 4 6 8 Processing Time 3 6 4 5 2 Ready List:

10

15

20
76

Round-Robin Scheduling

Process 1 2 3 4 5 Arrival Time 0 2 4 6 8 Processing Time 3 6 4 5 2 Ready List:

10

15

20
77

Round-Robin Scheduling

Process 1 2 3 4 5 Arrival Time 0 2 4 6 8 Processing Time 3 6 4 5 2 Ready List:

10

15

20
78

Round-Robin Scheduling

Process 1 2 3 4 5 Arrival Time 0 2 4 6 8 Processing Time 3 6 4 5 2 Ready List:

10

15

20
79

Round-Robin Scheduling

Process 1 2 3 4 5 Arrival Time 0 2 4 6 8 Processing Time 3 6 4 5 2 Ready List:

10

15

20
80

Round-Robin Scheduling

Process 1 2 3 4 5 Arrival Time 0 2 4 6 8 Processing Time 3 6 4 5 2 Ready List:

10

15

20
81

Round-Robin Scheduling

Process 1 2 3 4 5 Arrival Time 0 2 4 6 8 Processing Time 3 6 4 5 2 Ready List:

10

15

20
82

Round-Robin Scheduling

Process 1 2 3 4 5 Arrival Time 0 2 4 6 8 Processing Time 3 6 4 5 2

10

15

20
83

Round-Robin Scheduling

Process 1 2 3 4 5 Arrival Time 0 2 4 6 8 Processing Time 3 6 4 5 2 Turnaround Delay Time 1 4 10 16 9 13 9 14 5 7

10

15

20
84

You might also like