33
3

Using Kotlin - Assumption Universityportal.scitech.au.edu/anilkumar/wp-content/uploads/...15 Same goes for when P3 arrives. After the P3 is done, Automatically looks for the next shortest

  • Upload
    others

  • View
    1

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Using Kotlin - Assumption Universityportal.scitech.au.edu/anilkumar/wp-content/uploads/...15 Same goes for when P3 arrives. After the P3 is done, Automatically looks for the next shortest

3

Page 2: Using Kotlin - Assumption Universityportal.scitech.au.edu/anilkumar/wp-content/uploads/...15 Same goes for when P3 arrives. After the P3 is done, Automatically looks for the next shortest

4

Using Kotlin via Eclipse Java Neon

Page 3: Using Kotlin - Assumption Universityportal.scitech.au.edu/anilkumar/wp-content/uploads/...15 Same goes for when P3 arrives. After the P3 is done, Automatically looks for the next shortest

5

To Simulate How ‘Os’

Schedules processes

Page 4: Using Kotlin - Assumption Universityportal.scitech.au.edu/anilkumar/wp-content/uploads/...15 Same goes for when P3 arrives. After the P3 is done, Automatically looks for the next shortest

6

1.First Come First Serve

Page 5: Using Kotlin - Assumption Universityportal.scitech.au.edu/anilkumar/wp-content/uploads/...15 Same goes for when P3 arrives. After the P3 is done, Automatically looks for the next shortest

7

The key is to execute the process in order of their arrival

Page 6: Using Kotlin - Assumption Universityportal.scitech.au.edu/anilkumar/wp-content/uploads/...15 Same goes for when P3 arrives. After the P3 is done, Automatically looks for the next shortest

8

As soon as the process arrives.. …

We directly follows the order its come in

Page 7: Using Kotlin - Assumption Universityportal.scitech.au.edu/anilkumar/wp-content/uploads/...15 Same goes for when P3 arrives. After the P3 is done, Automatically looks for the next shortest

9

The waiting time could be calculate as follows

Page 8: Using Kotlin - Assumption Universityportal.scitech.au.edu/anilkumar/wp-content/uploads/...15 Same goes for when P3 arrives. After the P3 is done, Automatically looks for the next shortest

10

The waiting could be calculate as follows

Finished time –

(Arrival time + Burst time)

Page 9: Using Kotlin - Assumption Universityportal.scitech.au.edu/anilkumar/wp-content/uploads/...15 Same goes for when P3 arrives. After the P3 is done, Automatically looks for the next shortest

11

2.Shortest Job First

Page 10: Using Kotlin - Assumption Universityportal.scitech.au.edu/anilkumar/wp-content/uploads/...15 Same goes for when P3 arrives. After the P3 is done, Automatically looks for the next shortest

12

Focuses on shortest process first,

before actually touching time-consuming ones

Page 11: Using Kotlin - Assumption Universityportal.scitech.au.edu/anilkumar/wp-content/uploads/...15 Same goes for when P3 arrives. After the P3 is done, Automatically looks for the next shortest

13

Loops through the process pool to pick the shortest one

Page 12: Using Kotlin - Assumption Universityportal.scitech.au.edu/anilkumar/wp-content/uploads/...15 Same goes for when P3 arrives. After the P3 is done, Automatically looks for the next shortest

14

Since P1 burst time is 6, as P2 arrives

with less burst time. The algorithm instantly shift to work on P2

Page 13: Using Kotlin - Assumption Universityportal.scitech.au.edu/anilkumar/wp-content/uploads/...15 Same goes for when P3 arrives. After the P3 is done, Automatically looks for the next shortest

15

Same goes for when P3 arrives. After the P3 is done,

Automatically looks for the next shortest job

that is left in the pool

Page 14: Using Kotlin - Assumption Universityportal.scitech.au.edu/anilkumar/wp-content/uploads/...15 Same goes for when P3 arrives. After the P3 is done, Automatically looks for the next shortest

16

The waiting time can be calculate the same way as the first algorithm

Page 15: Using Kotlin - Assumption Universityportal.scitech.au.edu/anilkumar/wp-content/uploads/...15 Same goes for when P3 arrives. After the P3 is done, Automatically looks for the next shortest

17

The waiting time can be calculate the same way as the first algorithm

Finished time –

(Arrival time + Burst time)

Page 16: Using Kotlin - Assumption Universityportal.scitech.au.edu/anilkumar/wp-content/uploads/...15 Same goes for when P3 arrives. After the P3 is done, Automatically looks for the next shortest

18

3.Priority Queue

Page 17: Using Kotlin - Assumption Universityportal.scitech.au.edu/anilkumar/wp-content/uploads/...15 Same goes for when P3 arrives. After the P3 is done, Automatically looks for the next shortest

19

Add priority variable; Determines which jobs to be executed fist

Page 18: Using Kotlin - Assumption Universityportal.scitech.au.edu/anilkumar/wp-content/uploads/...15 Same goes for when P3 arrives. After the P3 is done, Automatically looks for the next shortest

20

Loops through the process pool to pick the shortest one

Page 19: Using Kotlin - Assumption Universityportal.scitech.au.edu/anilkumar/wp-content/uploads/...15 Same goes for when P3 arrives. After the P3 is done, Automatically looks for the next shortest

21

If a higher priority task arrives, pause the current one to prioritize it first

Page 20: Using Kotlin - Assumption Universityportal.scitech.au.edu/anilkumar/wp-content/uploads/...15 Same goes for when P3 arrives. After the P3 is done, Automatically looks for the next shortest

22

Since P2 has higher priority, immediately switch to P2.

Page 21: Using Kotlin - Assumption Universityportal.scitech.au.edu/anilkumar/wp-content/uploads/...15 Same goes for when P3 arrives. After the P3 is done, Automatically looks for the next shortest

23

The same goes for when P4 which has highest priority arrives

Page 22: Using Kotlin - Assumption Universityportal.scitech.au.edu/anilkumar/wp-content/uploads/...15 Same goes for when P3 arrives. After the P3 is done, Automatically looks for the next shortest

24

The waiting time can still be calculate the same way as the first algorithm

Page 23: Using Kotlin - Assumption Universityportal.scitech.au.edu/anilkumar/wp-content/uploads/...15 Same goes for when P3 arrives. After the P3 is done, Automatically looks for the next shortest

25

The waiting time can still be calculate the same way as the first algorithm

Finished time –

(Arrival time + Burst time)

Page 24: Using Kotlin - Assumption Universityportal.scitech.au.edu/anilkumar/wp-content/uploads/...15 Same goes for when P3 arrives. After the P3 is done, Automatically looks for the next shortest

26

4.RoundRobin

Page 25: Using Kotlin - Assumption Universityportal.scitech.au.edu/anilkumar/wp-content/uploads/...15 Same goes for when P3 arrives. After the P3 is done, Automatically looks for the next shortest

27

Introduce quantum; Fairly divides tasks amongst

processes in the pool

Page 26: Using Kotlin - Assumption Universityportal.scitech.au.edu/anilkumar/wp-content/uploads/...15 Same goes for when P3 arrives. After the P3 is done, Automatically looks for the next shortest

28

Each tasks will be execute concurrently and equally

Page 27: Using Kotlin - Assumption Universityportal.scitech.au.edu/anilkumar/wp-content/uploads/...15 Same goes for when P3 arrives. After the P3 is done, Automatically looks for the next shortest

29

Ensures all tasks progress

Page 28: Using Kotlin - Assumption Universityportal.scitech.au.edu/anilkumar/wp-content/uploads/...15 Same goes for when P3 arrives. After the P3 is done, Automatically looks for the next shortest

30

Executes each task for a turn of 3 (quantum)

Page 29: Using Kotlin - Assumption Universityportal.scitech.au.edu/anilkumar/wp-content/uploads/...15 Same goes for when P3 arrives. After the P3 is done, Automatically looks for the next shortest

31

Notice when one task is done and the quantum is yet complete, it utilize

the remaining turn on the next task In P1 to P2 to P2

(6th quantum)

Page 30: Using Kotlin - Assumption Universityportal.scitech.au.edu/anilkumar/wp-content/uploads/...15 Same goes for when P3 arrives. After the P3 is done, Automatically looks for the next shortest

32

Since in round robin, we neglect arrival time.

Page 31: Using Kotlin - Assumption Universityportal.scitech.au.edu/anilkumar/wp-content/uploads/...15 Same goes for when P3 arrives. After the P3 is done, Automatically looks for the next shortest

33

Hence a difference in waiting time calculation

Page 32: Using Kotlin - Assumption Universityportal.scitech.au.edu/anilkumar/wp-content/uploads/...15 Same goes for when P3 arrives. After the P3 is done, Automatically looks for the next shortest

34

Hence a difference in waiting time calculation

Finished time –

Burst time

Page 33: Using Kotlin - Assumption Universityportal.scitech.au.edu/anilkumar/wp-content/uploads/...15 Same goes for when P3 arrives. After the P3 is done, Automatically looks for the next shortest

Neal Creative | click & Learn more Neal Creative ©

THANK YOU

U5911694 Rachatha Pramualsuk