Sharing memory, Operating System

Assignment Help:

As we have discussed, page tables map virtual page addresses to physical page addresses. One of the advantages of using virtual addresses is that we can achieve complete separation between processes, in terms of address spaces. One drawback to this is that it is convenient to be able to share some things, for example library code which would otherwise be replicated wastefully by many different programs. We don't want to have to load exactly the same library code into every process' address space; we'd prefer to map the library code to its own pages, and let all processes share those pages. This will usually reduce the memory requirements for the system. In order to do this, we need to do some common tricks with page tables.

The ?rst important memory-sharing concept is known as Copy-On-Write, or COW. COW shares pages by default, whenever sharing is still possible. Whenever a new process is created, for example by fork(), we "clone" an old process by making a copy of its page tables and marking all referenced pages as read-only.

Then whenever either of the processes (the original one, or the clone) tries to write to one of the pages, the two processes will differ, and sharing is no longer possible. The OS allocates a new page and changes the mapping in one of the page tables. If neither of the processes ever tries to modify a memory location, however, the processes will share the same (read-only) pages forever! COWtries to maximize the amount of sharing at all times.


Related Discussions:- Sharing memory

Explain the various methods of file access, Operating Systems 1. Illust...

Operating Systems 1. Illustrate the Microkernel Architecture with suitable diagram. 2. When Deadlock occurs? What are the Necessary Conditions for Deadlock? 3. Describe f

#title.paging, explain hierarchical,hashed and inverted paging

explain hierarchical,hashed and inverted paging

Explain the os/2 operating system, Explain the OS/2 Operating System Li...

Explain the OS/2 Operating System Like NetWare, OS/2 manage resources at three levels, as shown in Figure 4.5 Resources may be maintained at the session, process, and thread le

Explain internal fragmentation, Explain internal fragmentation The Inter...

Explain internal fragmentation The Internal fragmentation signifies to the result of reserving a piece of space without ever intending to use it. This space is wasted that this

Explain the fork-join, Explain the Fork-join This is primitives in a hi...

Explain the Fork-join This is primitives in a higher level programming language for implementing interacting processes. The syntax is like this: fork ; join ; where

Making the transition to client - server programming, Making the Transition...

Making the Transition to Client - Server Programming Making the transition to client - server programming is a significant effort. Client - server applications must be designed

What is direct access, Normal 0 false false false EN-IN...

Normal 0 false false false EN-IN X-NONE X-NONE MicrosoftInternetExplorer4

Pthreads, A thread is defined as an independent stream of instructions that...

A thread is defined as an independent stream of instructions that can be scheduled to run as such by the operating system. Each program contains a number of threads which can be ru

Define a layer that is not of an io management module, Define a layer that ...

Define a layer that is not of an IO management module  MCS that is Management Control System is not of an IO management module

Explain the tlssetvalue (tlsindex, Explain the TlsSetValue (TLSindex, dataP...

Explain the TlsSetValue (TLSindex, dataPtr)Function The TlsSetValue function  associates the  dataPtr passed as a parameter as local storage for the requesting thread. The asso

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd