Professional Documents
Culture Documents
COMP313 - Test 3 - Model: Virtual Memory & Scheduling Question One
COMP313 - Test 3 - Model: Virtual Memory & Scheduling Question One
a) demand-paging [3]
only the missing page is fetched from auxiliary memory and page replacements only occur when
memory is full
b) forward-distance [3]
1.2) Consider a machine with three (3) page frames and eight (8) pages that is processing the
following reference string W.
W = 0, 1, 7, 5, 2, 6, 4, 5, 3, 6, 3, 2, 5, 4, 0, 5, 7, 7
Note: Show all working (i.e. show the memory state after each replacement).
a) How many page faults will occur when using the Least
Frequently Used paging algorithm? Use First In First Out (FIFO)
is the tie-breaking rule. [4]
017
517 F
527 F
526 F
426 F
456 F
453 F
653 F
623 F
523 F
524 F
504 F
507 F
12 faults
b) How many page faults will occur when using Belady’s optimal
algorithm? [4]
017
057 F
052 F
652 F
654 F
653 F
652 F
654 F
650 F
657 F
9 faults
| p0 | p1 | p2 | p3 | p4 | p1 | p2 | p3 | p4 | p4 |
0 3 7 11 15 19 20 22 26 30 31
(b) What is the average throughput time for the tasks? [5]
p0 - 3
p1 - 17
p2 - 15
p3 - 15
p4 - 16
13.2 (ave throughput time)
(a) Create a Gantt chart illustrating the execution of these tasks. [5]
p2 p6
p0 p5
p1 p3 p4
(b) What is the total throughput time for the tasks? [5]
7.5