Saturday, January 21, 2012

Shared memory


Shared memory is piece of memory which can be accessed simultaneously by multiple programs with an ability to provide inter communication among them with avoiding redundant copies.
It is large block of random access memory that can be accessed by several different CPUs in multi process computer system. All the processors share a single view of data and the communication between processors can be as fast as memory accesses to a same location.

It allows inter process communication, process can create area in RAM which other process can access. When one memory location gets updated with some information by processor, change needs to be reflected to the other processors. It can create the data discrepancy, if the access in controlled properly (concurrency needs to be maintained by different means of methods).

Since multiple processes can access the shared area like normal memory, it will allow fast communication. Dynamic libraries are generally held in memory once mapped to different processes, and paging gets done based on individual process starts accessing. Based on number of process accesses different copies gets generated and maintained in shared space. Upon writing to each, it writes to local copy and then the main copy gets updated.

References - Wiki, OS

No comments:

Post a Comment