Computing for Ordinary Mortals by St.Amant Robert

Computing for Ordinary Mortals by St.Amant Robert

Author:St.Amant, Robert [St.Amant, Robert]
Language: eng
Format: epub, mobi
Publisher: Oxford University Press
Published: 2012-09-30T22:00:00+00:00


Figure 6.11. Breaking up memory into smaller regions, with indirection, lets a process see different areas of memory as a single block.

The rest is kept in secondary storage. If the process hasn’t used one of its pages for some amount of time, the information on that page can be copied to secondary storage and that page reused by another process. (A workable policy is to reuse pages that haven’t been touched in a while.)

The operating system brings the information on the first process’s page back into memory only when it’s needed next. The effect is that the operating system is reusing memory, often between processes, allocating frames to one process and then taking them back and reallocating them to another process. Individual processes can still run as if they have as much memory as they need, because they don’t need it all at once. Alternatively, we can think of memory as being a relatively fast cache for process information on secondary storage.

Demand paging is a way to implement virtual memory, which lets processes act as if there’s much more memory than there actually is. This is a powerful idea that extends beyond the operating system. For example, imagine wandering through a large virtual computer environment, which could be an imaginary city or an alien planet. You can look around and walk (or perhaps fly) from one place to another. But your display shows you only a small part of the scenery at any time. If the system can make the right information available at just the right time, you’re given the impression that the space you’re moving through is enormous. Your virtual environment can even be infinitely large, if the system can generate the necessary information on the fly.

We can also see analogies to virtual memory in the physical world. Have you ever played basketball on a half-court? You’re applying the same idea. When your team controls the ball, you treat the basket as your own, until control changes over to the other team. At that point there’s a conceptual shift—the physical space gets reused, with the other team now treating the basket as their own. Or in a movie, we might see actors wandering through the rooms in a large mansion. That mansion probably doesn’t exist in reality, and some of the rooms might even be reused in different scenes, slightly redecorated, as if they were other rooms. The same idea is at work, in which we have a small physical space that, practically speaking, we can reuse at different times for different activities.



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.