WINSEM2022-23 CSE4001 ETH VL2022230503162 ReferenceMaterialI TueFeb1400 00 00IST2023 Module4DistributedSystemsLecture2
WINSEM2022-23 CSE4001 ETH VL2022230503162 ReferenceMaterialI TueFeb1400 00 00IST2023 Module4DistributedSystemsLecture2
MODULE IV
Distributed Shared Memory (DSM)
Distributed Shared Memory (DSM)
• an abstraction used for sharing data between computers that do not share physical memory
• main goals of DSM:
(1) to overcome the architectural limitations (memory size) and
(2) to support a better programming paradigm
Advantages
• Message passing is hidden
• Programming is much easier
• Provides large virtual memory space
• Can handle complex and large databases
• Scales well with a large number of nodes
• Cheaper than using a multiprocessor system
• Shield programmers from sending or receiving primitives
• Programs for shared memory multiprocessors can easily be ported to DSMs
Disadvantages
• Generally slower to access than non-distributed shared memory
• Must provide additional protection against simultaneous accesses to shared data
• DSM implementations use asynchronous message-passing, and hence cannot be
more efficient than message passing implementations
Challenges in Distributed Shared Memory
2. How to overcome the communication delays and high overhead associated with the
references to remote data?
1. Central-server algorithm
2. Migration algorithm
Hardware based
• cache coherence circuits and network interfaces
Software based
• page based approach using the system’s virtual memory;
• shared variable approach using some routines to access shared variables;
• object based approach ideally accessing shared data through object-oriented
discipline.
Memory Coherence
• The set of allowable memory access orderings forms the memory consistency model.
• A memory is coherent if the value returned by a read operation is always the value that the
programmer expected.
Two types of basic cache coherence protocols
• Write-Invalidate Protocol: a write to a shared data causes the invalidation of all copies except one
before the write.
• Write-Update Protocol: A write to a shared data causes all copies of that data to be updated.
Consistency Models
DSM must follow certain rules to maintain consistency over how read and write order is
viewed among nodes, called the system's consistency model
Memory Coherence
• Strict consistency model is typical in uniprocessor: a read returns the most recent written
value.
• it is very costly to enforce the strict consistency model in distributed systems: how
to determine last write?
• To improve performance, we need relax memory consistency model.
Challenges
Programmers has the complete responsibility - decompose the computations and extract
concurrency – achieve parallelism
Build algorithms that reduce the access of non-local resources to minimize costs
Structure of Message Passing Programs
Synchronous Paradigm
Tasks or subsets of tasks synchronize to perform interactions.
However, between these interactions, tasks execute completely asynchronously.
Asynchronous Paradigm
All concurrent tasks execute asynchronously - makes it possible to implement any parallel
algorithm.
However, such programs can be harder to reason about, and can have nondeterministic
behavior due to race conditions.
Syntax:
Example:
Deadlocks are very easy in blocking protocols and care must be taken to break cyclic waits
Blocking Message Passing Operations
2. Blocking Buffered Send/Receive
Blocking Message Passing Operations