What is a distributed shared memory? And its advantages
A distributed shared memory (DSM) system is a collection of many nodes/computers which are connected through some network and all have their local memories. The DSM system manages the memory across all the nodes. All the nodes/computers transparently interconnect and process. The DSM also makes sure that all the nodes are accessing the virtual memory independently without any interference from other nodes. The DSM does not have any physical memory, instead, a virtual space address is shared among all the nodes, and the transfer of data occurs among them through the main memory.
Let us now discuss some different types of Distributed shared memory:
- On-Chip Memory:
- All the data are stored in the CPU's chip.
- There is a direct connection between Memory and address lines.
- The On-Chip Memory DSM is very costly and complicated.
- Bus-Based Microprocessor
- The connection between the memory and the CPU is established through a number of parallel wires that acts as a bus.
- All the computer follows some protocols to access the memory, and an algorithm is implemented to prevent memory access by the systems at the same time.
- The network traffic is reduced by the cache memory.
- Ring-based Microprocessor
- In Ring-based DSM, there is no centralized memory present
- All the nodes are connected through some link/network, and accessing of memory is done by the token passing
- All the nodes/computers present in the shared area access a single address line in this system
Let us now see some advantages of Distributed Shared Memory system:
- Easy Abstraction - Since the address space is the same, data migration is not an issue for programmers, making it simpler to build than RPC.
- Easier Potability - Sequential to distributed system migration is made easy by the access protocols employed in DSM. Because they make use of a common programming interface, DSM programmes are portable.
- Locality of data - Data that is being fetched in large blocks, or data that is close to the memory address being fetched, may be needed in the future.
- Larger memory space - Large virtual memory space is provided, paging operations are decreased, and the total memory size is the sum of the memory sizes of all the nodes.
- Better Performance - It speeds up the data access in order to increase the performance of the system.
- Flexible communication Environment - There is no requirement for the sender and receiver to be present, thus they can join and leave the DSM system without influencing the others.
- Simplified process Migration - Since they all share the same address space, moving one process to a different computer is simple
Some more basic advantages of the distributed shared memory (DSM) system are listed below:
- It is less expensive than using multiprocessing systems
- Data access is done smoothly
- It provides better scalability as several nodes can access the memory.
Now let's see the disadvantages of the distributed shared memory:
- Accessing is faster in a non-distributed shared memory system than in a distributed system.
- Simultaneous access to data has always been a topic of discussion. It should ensure some additional protection to it.
- It generates some programmer control over the actual message
- In order to write correct programs, programmers must learn the consistency model
- It is not much efficient as the message-passing implementation as it uses the asynchronous message-passing implementations.
Difference between Message Passing and Distributed shared memory:
|Distributed shared memory
|Variables are directly shared
||Variables are formalized.
|Less cost of communication
||More Costs of communication
|Errors may occur by altering the data by the processes.
||Private address space is associated with the processes which prevents the occurrence of errors.
|Processes cannot run simultaneously.
||Processes may run at the same time.