Presentation is loading. Please wait.

Presentation is loading. Please wait.

Clock Algorithm Example

Similar presentations


Presentation on theme: "Clock Algorithm Example"— Presentation transcript:

1 Clock Algorithm Example
Process 1 PT Memory Address Space 1 2 3 4 Frame Table Free PID Ref Backing Store Frame Update Disk Valid Process 2 PT Address Space Frame Update Disk Valid CSE 5343/7343 Fall 2002

2 Start State 1 2 3 4 CSE 5343/7343 Fall 2002 Memory Frame Table Free
1 2 3 4 Frame Table Free PID Ref 1 Backing Store CSE 5343/7343 Fall 2002

3 Create Process 1 / Load into VM
PT Memory ^ Address Space 1 2 3 4 A B C D Frame Table Free PID Ref 1 Backing Store Frame Update Disk Valid CSE 5343/7343 Fall 2002

4 Load 1st Two Pages of P1 into Memory
Process 1 PT Memory 1 3 ^ 1 A B Address Space 1 2 3 4 A B C D Frame Table 1 1 Backing Store Frame Update Disk Valid Free Ref PID CSE 5343/7343 Fall 2002

5 P1 Begins Executing using Pages 0&1
Process 1 PT Memory 1 3 ^ 1 A B Address Space 1 2 3 4 A B C D Frame Table 1 1 1 Backing Store Frame Update Disk Valid Free Ref PID CSE 5343/7343 Fall 2002

6 Create Process 2 / Load into VM
PT Memory 1 3 ^ 1 A B Address Space 1 2 3 4 A B C D Frame Table 1 1 1 Backing Store Frame Update Disk Valid Process 2 PT Address Space Free Ref PID D E F ^ Frame Update Disk Valid CSE 5343/7343 Fall 2002

7 Load 1st Two Pages of P2 into Memory
Process 1 PT Memory 1 3 ^ 1 E A D B Address Space 1 2 3 4 A B C D Frame Table 1 1 2 1 Backing Store Frame Update Disk Valid Process 2 PT Address Space Free Ref PID D E F 2 ^ 1 Frame Update Disk Valid CSE 5343/7343 Fall 2002

8 P2 Begins Executing using Pages 0&1 – Update Page 1
Process 1 PT Memory 1 3 ^ 1 E A D B Address Space 1 2 3 4 A B C D Frame Table 1 1 2 1 Backing Store Frame Update Disk Valid Process 2 PT Address Space Free Ref PID D E F 2 1 ^ 1 Frame Update Disk Valid CSE 5343/7343 Fall 2002

9 P2 Page Fault for Page 2 – P1 Executes During Paging I/O
Process 1 PT Memory 1 3 ^ 1 E A D B F Address Space 1 2 3 4 A B C D Frame Table 1 2 1 Backing Store Frame Update Disk Valid Process 2 PT Address Space Free Ref PID D E F 2 4 1 ^ 1 Frame Update Disk Valid CSE 5343/7343 Fall 2002

10 I/O Completion Interrupt – P2 Begins Execution - Updates Page 2
Process 1 PT Memory 1 3 ^ 1 E A D B F Address Space 1 2 3 4 A B C D Frame Table 1 2 1 Backing Store Frame Update Disk Valid Process 2 PT Address Space Free Ref PID D E F 2 4 1 ^ 1 Frame Update Disk Valid CSE 5343/7343 Fall 2002

11 Timer Interrupt – P1 Begins Execution – Page Fault for Page 2 – No Free Frames – Initiate Clock Algorithm for Page Replacement Process 1 Backing Store Address Space PT Frame Update Disk Valid A B C D ^ 1 3 Process 2 E F 2 4 Memory E A D B F 1 2 3 4 Frame Table Free PID Ref 2 1 1 1 1 1 CSE 5343/7343 Fall 2002

12 Replace Frame 0 – Must swap out to disk as updated
Process 1 PT Memory 1 3 ^ 1 C A D B F Address Space 1 2 3 4 A B C D Frame Table 1 2 Backing Store Frame Update Disk Valid Process 2 PT Address Space Free Ref PID D E F 2 4 1 2 ^ 1 Frame Update Disk Valid CSE 5343/7343 Fall 2002


Download ppt "Clock Algorithm Example"

Similar presentations


Ads by Google