It's UWAweek 47

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 6 articles in this topic
Showing 6 of 828 articles.
Currently 73 other people reading this forum.


 UWA week 40 (2nd semester, week 10) ↓
SVG not supported

Login to reply

👍?
helpful
10:56pm Sun 6th Oct, ANONYMOUS

Because of the line "The simulation starts by reading a file where there is a single line of integers separated by blanks" do we need to error check for multiple lines or will it just be assumed we wont be provided with more than one line in the in.txt file?


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

Login to reply

👍?
helpful
10:37am Mon 7th Oct, Kristiaan M.

the way I understand the project is that it starts loaded in with the first 2 processes (page numbers 0-7) but because there are 16 pages in disc there is also a copy of process 0 and 1 in disc so instruction 0: bring in least recently used page into RAM from process 0 - currently in disc there are 4 pages in process 0 all with page num 99 and and time step 0 since there is no space in RAM we evict the smallest time step (process 0, time step 0, page num 0) now we add (process 0, time step 0, page num 0) from the disc now we increment the time step this would repeat until the 5th 0, I'm not quite sure what would happen here because in the given sample output they demonstrate that the time step can be greater than 1 but we are also not supposed to modify the disc so I am not sure how this is possible


SVG not supported

Login to reply

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

ANONYMOUS wrote:
> Because of the line "The simulation starts by reading a file where there is a single line of > integers separated by blanks" do we need to error check for multiple lines or will it just be assumed we wont be provided with more than one line in the in.txt file?
You would just ignore all lines except the first. However, best practice is to stop processing the file if you detect multiple lines since you would assume the file was corrupted.


SVG not supported

Login to reply

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

"Kristiaan Maree" <24*1*7*3@s*u*e*t*u*a*e*u*a*> wrote:
> the way I understand the project is that it starts loaded in with the first 2 processes (page numbers 0-7) but because there are 16 pages in disc there is also a copy of process 0 and 1 in disc
RAM starts empty. You only load processes based on the file.
> so instruction 0: > bring in least recently used page into RAM from process 0 - currently in disc there are 4 pages in process 0 all with page num 99 and and time step 0 > since there is no space in RAM we evict the smallest time step (process 0, time step 0, page num 0)
At instruction 0, there is no process to evict. Since the RAM is empty.
> now we add (process 0, time step 0, page num 0) from the disc > now we increment the time step > > this would repeat until the 5th 0, I'm not quite sure what would happen here because in the given sample output they demonstrate that the time step can be greater than 1 but we are also not supposed to modify the disc so I am not sure how this is possible
Amitava said a process can only be loaded once. So, the fifth 0 would be ignored. I think that was a mistake on Amitava's part, you still need to change the last accessed time.


SVG not supported

Login to reply

👍?
helpful
6:11pm Mon 7th Oct, Chenjun H.

Hi, Just 2 questions about the assignment, With the global least recently used eviction policy, does this only occur when we try to add a page already in the memory to the memory? Also, since the output is only interested in the ram, what is the purpose of the disk? Can't we simulate the virtual memory just using a ram array, since no information is stored in the pages? Thanks


SVG not supported

Login to reply

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

"Chenjun Hou" <23*6*8*9@s*u*e*t*u*a*e*u*a*> wrote:
> Hi, Just 2 questions about the assignment, > > With the global least recently used eviction policy, does this only occur when we try to add a page already in the memory to the memory?
Occurs when RAM is full and you are trying to load a new page into memory. E.g. If page 0 of process zero is in memory and RAM is full and you are trying to load the next page of process 0, then you evict the least recently loaded page of process 0 (in this case page 0) to make room for page 1.
> Also, since the output is only interested in the ram, what is the purpose of the disk? Can't we simulate the virtual memory just using a ram array, since no information is stored in the pages?
Yes, you could, but I'm not sure if that's what Amitava intends. I think he wants you to pass pointers around, which is the only purpose of virtual memory, to store the pointers.
> Thanks
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