It's UWAweek 45 (2nd semester, 2nd exam week)

help2002

This forum is provided to promote discussion amongst students enrolled in CITS2002 Systems Programming.
Please consider offering answers and suggestions to help other students! And if you fix a problem by following a suggestion here, it would be great if other interested students could see a short "Great, fixed it!"  followup message.
Displaying the 4 articles in this topic
Showing 4 of 821 articles.
Currently 7 other people reading this forum.


 UWA week 41 (2nd semester, week 11) ↓
SVG not supported

Login to reply

👍?
helpful
10:05am Mon 7th Oct, ANONYMOUS

Hello, I know this quesiton has been answered but I dont fully understand it. If the input is: 0 0 0 0 0 0 Would it load the first 4 pages into RAM then reload the first page then reload the second page, with the reloaded pages having new time stamps? Also, if parts of the RAM arent used, do we need to include it in the output with something like "EMPTY" or can we just not print it. For example in the case where input is 0 1 Can we have the RAM output of 0,0,0;0,0,0;1,0,1;1,0,1; Thanks


SVG not supported

Login to reply

👍?
helpful
1:31pm Mon 7th Oct, Joshua N.

ANONYMOUS wrote:
> Hello, I know this quesiton has been answered but I dont fully understand it. > > If the input is: 0 0 0 0 0 0 > > Would it load the first 4 pages into RAM then reload the first page then reload the second page, with the reloaded pages having new time stamps?
Yes.
> Also, if parts of the RAM arent used, do we need to include it in the output with something like "EMPTY" or can we just not print it.
I believe you still have to print "Empty" unless Amitava clarifies.
> For example in the case where input is 0 1 > > Can we have the RAM output of > > 0,0,0;0,0,0;1,0,1;1,0,1; > > Thanks
I wouldn't say so since the spec states to print the contents of RAM, which would include the empty slots.


SVG not supported

Login to reply

👍?
helpful
12:49pm Fri 11th Oct, ANONYMOUS

Hi, I have the following questions about Project 2. 1. Based on the response in the post below stating that a process can only be loaded into RAM once, does this mean that after the fourth page (with page number = 3) of a process has been loaded into RAM, no more pages of the process can be loaded into RAM again (i.e. any further appearances of the process in in.txt will be ignored once the fourth page of the process has been loaded into RAM)? [help2002] 2. I have seen that a response in a previous post states that we are simply "moving" pointers in and out of RAM. But in my solution, before any pages are loaded, I initialise the RAM by filling it with struct pointers such that the fields (process_id, page_num, last_accessed) are all set to -1. After this, I don't "move" any pointers in and out of RAM when I load a new page as I just update the fields of the structs in the appropriate RAM array locations. Is what I am doing acceptable? Thank you


SVG not supported

Login to reply

👍?
helpful
5:32pm Fri 11th Oct, Joshua N.

ANONYMOUS wrote:
> Hi, I have the following questions about Project 2. > > 1. Based on the response in the post below stating that a process can only be loaded into RAM once, does this mean that after the fourth page (with page number = 3) of a process has been loaded into RAM, no more pages of the process can be loaded into RAM again (i.e. any further appearances of the process in in.txt will be ignored once the fourth page of the process has been loaded into RAM)? > > [help2002]
Yes, Amitava said you can either do that or reload the pg 0 again (which would just be updating the "last_accessed" variable).
> 2. I have seen that a response in a previous post states that we are simply "moving" pointers in and out of RAM. > > But in my solution, before any pages are loaded, I initialise the RAM by filling it with struct pointers such that the fields (process_id, page_num, last_accessed) are all set to -1. > > After this, I don't "move" any pointers in and out of RAM when I load a new page as I just update the fields of the structs in the appropriate RAM array locations. Is what I am doing acceptable?
I believe moving pointers was the intention, otherwise using an array of pointers to structs wouldn't have any other benefit from just using an array of structs. You'd have to check with Amitava to be completely sure.
> Thank you
np

The University of Western Australia

Computer Science and Software Engineering

CRICOS Code: 00126G
Written by [email protected]
Powered by history
Feedback always welcome - it makes our software better!
Last modified  8:08AM Aug 25 2024
Privacy policy