[Solved] CSC3002F Assignment3-Memory Management

$25

File Name: CSC3002F_Assignment3-Memory_Management.zip
File Size: 357.96 KB

SKU: [Solved] CSC3002F Assignment3-Memory Management Category: Tag:
5/5 - (1 vote)

Write a Python program that implements the FIFO, LRU, and optimal page replacement algorithms presented in Chapter 9: Virtual Memory of Silberschatz et al. [Silberschatz et al., 2012].

First, generate a random page-reference string where page numbers range from 0 to 9. Apply the random page-reference string to each algorithm, and record the number of page faults incurred by each algorithm.

Implement the FIFO, LRU, and optimal (OPT) replacement algorithms so that the number of page frames can vary from 1 to 7. Assume that demand paging is used. The main function should include the following.:

def main(): #TODO

size = int(sys.argv[1]) print FIFO, FIFO(size,pages), page faults. print LRU, LRU(size,pages), page faults. print OPT, OPT(size,pages), page faults.

if __name__ == __main__:

if len(sys.argv) != 2:

print Usage: python paging.py [number of pages] else:

main()

1

Implement these FIFO, LRU and OPT algorithms as functions within one file called paging.py, making sure that you clearly identify yourself (name and student number) in comments at the top of the file.

The total assignment mark (100) will be calculated as follows.:

  1. Correct implementation and functioning of FIFO.
  2. Correct implementation and functioning of LRU.
  3. Correct implementation and functioning of OPT.

Note: Values in bold parentheses are the percentage weighting of each question as a portion of the total assignment mark.

Reviews

There are no reviews yet.

Only logged in customers who have purchased this product may leave a review.

Shopping Cart
[Solved] CSC3002F Assignment3-Memory Management
$25