It's UWAweek 44 (2nd semester, 1st 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 6 articles in this topic
Showing 6 of 820 articles.
Currently 33 other people reading this forum.


 UWA week 43 (2nd semester, study break) ↓
SVG not supported

Login to reply

👍?
helpful
3:00pm Thu 24th Oct, ANONYMOUS

"With reference to two distinct examples, explain the Principle of Referential locality, and explain how an operating system may use it to improve performance." Hi, in the above question, I am bit confused with the type of examples that would have to be provided. I think we covered principle of referential locality with respect to the paging scheme. So, does the examples have to reflect on that? Also, for the second part of the question do we need to basically cover the idea of Principle of referential locality in Virtual memory? Thank you for your help.


SVG not supported

Login to reply

👍x1
helpful
4:58pm Thu 24th Oct, ANONYMOUS

I am not Amitava or A lab facilitator so they may have better answers than mine but: For examples of referential locality. I would provide the examples of the activation stack and the executable code data. Executable code will frequently be executed sequentially (so the next instruction it needs is stored directly after the current one). Or in loops, so a small section of code (likely stored in a clump together) will be executed repeatedly. This means that there is a very high chance the next instruction we want is nearby to the current one. As for the stack, we only need to be able to access/view the top section of the stack (the section relevant to the current function call we are in). Hence the next bit of data we want to get from the stack will be 'clustered' in that top section of the stack, unless a return call occurs obviously. Both of these can be related to virtual memory and paging, in that this means we will typically access a small number of pages very frequently, and the rest of the pages quite infrequently. By bring in data in chunks (pages), this allows us to reduce the amount of swapping in a virtual memory system. (Maximising efficiency). Depending on the replacement algorithm you could also take this into account when removing pages, to reduce the chance it will need to be immediately swapped back in. (possibly could also argue that by removing non cluster pages we can minimise the working size needed for processes). Hopefully that helps in the place of a Josh or Amitava response for now.


SVG not supported

Login to reply

👍?
helpful
8:26pm Thu 24th Oct, Joshua N.

This is a good response.


SVG not supported

Login to reply

👍?
helpful
9:42pm Thu 24th Oct, ANONYMOUS

Question about the stack thing, when your saying that the next bit of data we want to get from the stack will be near the top is that in reference to the data in the stack or the location of the data in the stack? I assume the former and thats why a return call would mess it up because the function that it returns to might not be near the other?


SVG not supported

Login to reply

👍?
helpful
10:14pm Thu 24th Oct, ANONYMOUS

The stack is "built up" in a sense, so new items are added on top of the stack. When a function returns, the stack essentially (theres a bit more to it if you want to do some research) gets rid of everything that was added on top during the functioncall's time Which is why yes, depending on how long the function lasted for, the point that we return back down to in the stack might not be super close to the things we were accessing during the function call. So I suppose I'm referring to the data in the stack (that we are getting) and it's location (in that related data will typically be close together!), and yes you are correct that a function call could make you go back to something further away.


SVG not supported

Login to reply

👍?
helpful
7:36pm Fri 25th Oct, Amitava D.

ANONYMOUS wrote:
> I am not Amitava or A lab facilitator so they may have better answers than mine but: > > For examples of referential locality. I would provide the examples of the activation stack and the executable code data. > > Executable code will frequently be executed sequentially (so the next instruction it needs is stored directly after the current one). Or in loops, so a small section of code (likely stored in a clump together) will be executed repeatedly. This means that there is a very high chance the next instruction we want is nearby to the current one. > > As for the stack, we only need to be able to access/view the top section of the stack (the section relevant to the current function call we are in). Hence the next bit of data we want to get from the stack will be 'clustered' in that top section of the stack, unless a return call occurs obviously. > > Both of these can be related to virtual memory and paging, in that this means we will typically access a small number of pages very frequently, and the rest of the pages quite infrequently. By bring in data in chunks (pages), this allows us to reduce the amount of swapping in a virtual memory system. (Maximising efficiency). Depending on the replacement algorithm you could also take this into account when removing pages, to reduce the chance it will need to be immediately swapped back in. > > (possibly could also argue that by removing non cluster pages we can minimise the working size needed for processes). > > Hopefully that helps in the place of a Josh or Amitava response for now.
good answer, thanks

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