Upcoming SlideShare
×

# Sjf

11,726
-1

Published on

1 Like
Statistics
Notes
• Full Name
Comment goes here.

Are you sure you want to Yes No
• Be the first to comment

Views
Total Views
11,726
On Slideshare
0
From Embeds
0
Number of Embeds
2
Actions
Shares
0
131
0
Likes
1
Embeds 0
No embeds

No notes for slide

### Sjf

1. 1. SJF
2. 2. <ul><li>First: </li></ul><ul><li>nonpreemtive </li></ul>
3. 3. <ul><li>Four processes arrive on the same time </li></ul>
4. 4. 6 sec
5. 5. 6 sec 4 sec
6. 6. 6 sec 4 sec 8 sec
7. 7. 6 sec 4 sec 8 sec 3 sec
8. 8. 6 sec 4 sec 8 sec 3 sec
9. 9. 6 sec 4 sec 8 sec 3 sec
10. 10. 6 sec 4 sec 8 sec 3 sec
11. 11. 6 sec 4 sec 8 sec
12. 12. 6 sec 8 sec
13. 13. 6 sec 8 sec
14. 14. 8 sec
15. 15. 8 sec
16. 16. <ul><li>Second: </li></ul><ul><li>preemptive </li></ul>
17. 18. At time 0: P1 start
18. 19. At time 2: P2 arrive P2 needs 4 sec P1 still needs (7-2)= 5 sec
19. 20. At time 2: P2 needs 4 sec P1 still needs (7-2)= 5 sec
20. 21. At time 2: 4 sec < 5 sec
21. 22. At time 2: So, Begin P2
22. 23. At time 4: P3 arrive P3 needs 1 sec P2 still needs (4-2)= 2 sec
23. 24. At time 4: P3 arrive P3 needs 1 sec P2 still needs (4-2)= 2 sec
24. 25. At time 4: 1sec < 2 sec
25. 26. At time 4: So, Begin P3
26. 27. At time 5: P4 arrive P4 needs 4 sec P2 still needs (4-2)= 2 sec P1 still needs= 5 sec
27. 28. At time 5: P4 arrive P4 needs 4 sec P2 still needs (4-2)= 2 sec P1 still needs= 5 sec
28. 29. At time 5: 2 sec < 4sec< 5sec