Distributed Shared Memory
Distributed Shared Memory
Introduction
Distributed Shared Memory (DSM)
DSM is the designation for making a group of
interconnected computers, each with its own
memory, appear as though the physically
distributed memory is a single memory with
a single address space.
Making the main memory of a cluster of
computers look as though it is a single
memory with a single address space.
Then you can use shared memory
programming techniques.
1. Distributed Shared Memory
Still need messages or mechanisms
to get data to processor, but these
are hidden from the programmer:
1. Distributed Shared Memory
Advantages of DSM
System scalable
Hides the message passing - do not
explicitly specific sending messages
between processes
Can use simple extensions to sequential
programming
Can handle complex and large data
bases without replication or sending the
data to processes
1. Distributed Shared Memory
Disadvantages of DSM
May incur a performance penalty
Must provide for protection against
simultaneous access to shared data
(locks, etc.)
Little programmer control over actual
messages being generated
Performance of irregular problems in
particular may be difficult
2. Implementing Distributed
Shared Memory
Hardware
Special network interfaces and cache
coherence circuits
Software
Modifying the OS kernel
Adding a software layer between the
operating system and the application -
most convenient way for teaching
purposes
2.1 Software DSM Systems
Page based
Using the systems virtual memory
Shared variable approach
Using routines to access shared variables
Object based
Shared data within collection of objects.
Access to shared data through object
oriented discipline (ideally)
2.1 Software DSM Systems
Software Page Based DSM
Implementation
2.1 Software DSM Systems
Some Software DSM Systems
Treadmarks
Page based DSM system
Apparently not now available
JIAJIA
C based
Some users have said it required significant
modifications to work (in message-passing
calls)
Adsmith object based
C++ library routines
2.2 Hardware DSM Implementation
Special network interfaces and cache
coherence circuits are added to the
system to make a memory reference
to a remote look like a reference to a
local memory location
Typical examples are in clusters of
SMP machines
2.3 Managing Shared Data
There are several ways that a
processor could be given access to
shared data
The simplest solution is to have a central
server responsible for all read and write
routines.
Problem the server is the bottleneck
Solution?
2.3 Managing Shared Data
Multiple copies of data.
Allows simultaneous access by different
processors.
How do you maintain these copies using a
coherence policy?
One option is Multiple Reader/Single
Writer
When the writer changes the data they
have 2 choices
Update policy
Invalidate policy
2.3 Managing Shared Data
Another option is Multiple Reader /
Multiple Writer
This is the most complex scenario.
2.4 Multiple Reader/Single Writer
Policy in a Page-Based System
Remember that a page holds more than
one variable location.
Problem
A and B can change different things in the
same page
How do you deal with the consistency?
3. Achieving Consistent Memory in
a DSM System
The term memory consistency model
addresses when the current value of a
shared variable is seen by other
processors.
There are various models with
decreasing constraints to provide higher
performance.
3. Achieving Consistent Memory in
a DSM System
Consistency Models
Strict Consistency - Processors sees most
recent update,
i.e. read returns the most recent write to location.
Sequential Consistency - Result of any
execution same as an interleaving of
individual programs.
Relaxed Consistency- Delay making write
visible to reduce messages.
3. Achieving Consistent Memory in
a DSM System
Consistency Models (cont)
Weak consistency - programmer must use
synchronization operations to enforce
sequential consistency when necessary.
Release Consistency - programmer must use
specific synchronization operators, acquire
and release.
Lazy Release Consistency - update only
done at time of acquire.
3. Achieving Consistent Memory in
a DSM System
Strict Consistency
Every write immediately visible