ArticleslgStudy

computer science

Distributed shared memory

Distributed shared memory is a computer science topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand Distributed shared memory rather than just read about it. In short: In computer science, distributed shared memory (DSM) is a form of memory architecture where physically separated memories can be addressed as a single shared address space. The term "shared" does not mean that there is a single centralized memory, but that the address space is shared—i.e., the same physical address on two processors refers to the same location in memory.

Distributed shared memory — main illustration
Distributed shared memory — illustration

Key takeaways

  • Distributed shared memory belongs to computer science; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect Distributed shared memory to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of Distributed shared memory from memory before moving on to harder problems.

Reference excerpt

In computer science, distributed shared memory (DSM) is a form of memory architecture where physically separated memories can be addressed as a single shared address space. The term "shared" does not mean that there is a single centralized memory, but that the address space is shared—i.e., the same physical address on two processors refers to the same location in memory. Distributed global address space (DGAS), is a similar term for a wide class of software and hardware implementations, in which each node of a cluster has access to shared memory in addition to each node's private (i.e., not shared) memory.

Overview DSM can be achieved via software as well as hardware. Hardware examples include cache coherence circuits and network interface controllers. There are three ways of implementing DSM: page-based approach using virtual memory, shared-variable approach using routines to access shared variables and object-based approach, ideally accessing shared data through object-oriented discipline. DSM scales well with a large number of nodes and its message passing is hidden. It can handle complex and large databases without replication or sending the data to processes and is generally cheaper than using a multiprocessor system. It provides large virtual memory space, programs are more portable due to common programming interfaces and shield programmers from sending or receiving primitives. It is generally slower to access than non-distributed shared memory and must provide additional protection against simultaneous accesses to shared data. DSM may incur a performance penalty, there is little programmer control over actual messages being generated and consistency models are needed to write correct programs.

Comparison with message passing

Software DSM systems also have the flexibility to organize the shared memory region in different ways. The page-based approach organizes shared memory into pages of fixed size. In contrast, the object based approach organizes the shared memory region as an abstract space for storing shareable objects of variable sizes. Another commonly seen implementation uses a tuple space, in which the unit of sharing is a tuple. Shared memory architecture may involve separating memory into shared parts distributed amongst nodes and main memory, or distributing all memory between nodes. A coherence protocol, chosen in accordance with a consistency model, maintains memory coherence.

Directory memory coherence

Memory coherence is necessary such that the system which organizes the DSM is able to track and maintain the state of data blocks in nodes across the memories comprising the system. A directory is one such mechanism which maintains the state of cache blocks moving around the system.

States

A basic DSM will track at least three states among nodes for any given block in the directory. There will be some state to dictate the block as uncached (U), a state to dictate a block as exclusively owned or modified owned (EM), and a state to dictate a block as shared (S). As blocks come into the directory organization, they will transition from U to EM (ownership state) in the initial node. The state can transition to S when other nodes begin reading the block. There are two primary methods for allowing the system to track where blocks are cached and in what condition across each node. Home-centric request-response uses the home to service requests and drive states, whereas requester-centric allows each node to drive and manage its own requests through the home.

Home-centric request and response In a home-centric system, the DSM will avoid having to handle request-response races between nodes by allowing only one transaction to occur at a time until the home node has decided that the transaction is finished—usually when the home has received every responding processor's response to the request. An example of this is Intel's QPI home-source mode. The advantages of this approach are that it is simple to implement but its request-response strategy is slow and buffered due to the home node's limitations.

Requester-centric request and response

In a requester-centric system, the DSM will allow nodes to talk at will to each other through the home. This means that multiple nodes can attempt to start a transaction, but this requires additional considerations to ensure coherence. For example: when one node is processing a block, if it receives a request for that block from another node it will send a NAck (Negative Acknowledgement) to tell the initiator that the processing node cannot fulfill that request right away. An example of this is Intel's QPI snoop-source mode. This approach is fast but it does not naturally prevent race conditions and generates more bus traffic.

Consistency models The DSM must follow certain rules to maintain consistency over how read and write order is viewed among nodes, called the system's consistency model. In a situation where there are n processes and Mi memory operations for each process i, and that all the operations are executed sequentially. (M1 + M2 + ... + Mn)!/(M1! M2!... Mn!) are possible interleavings of the operations. The issue with this conclusion is determining the correctness of the interleaved operations. Memory coherence for DSM defines which interleavings are permitted.

Replication There are two types of replication algorithms. Read replication and Write replication: in Read replication multiple nodes can read at the same time but only one node can write, while in Write replication multiple nodes can read and write at the same time. The write requests are handled by a sequencer. Replication of shared data in general tends to reduce network traffic, promote increased parallelism and result in fewer page faults. Preserving coherence and consistency may become more challenging.

Release and entry consistency Release consistency is when a process exits a critical section, new values of the variables are propagated to all sites. Entry consistency is when a process enters a critical section, it will automatically update the values of the shared variables. View-based consistency is a variant of entry consistency, except the shared variables of a critical section are automatically detected by the system.

Examples Kerrighed Open SSI MOSIX TreadMarks VODCA Archived 2016-02-15 at the Wayback Machine DIPC

… excerpt ends here. Continue reading the full article.

Illustrations

Distributed shared memory: Distributed shared memory implementation.
Distributed shared memory implementation.
Distributed shared memory: A state diagram of a block of memory in a DSM. A block is "owned" if one of the nodes has the block in state EM.
A state diagram of a block of memory in a DSM. A block is "owned" if one of the nodes has the block in state EM.
Distributed shared memory: Sequential invocations and responses in DSM.
Sequential invocations and responses in DSM.

Worked examples

Example 1 — a first encounter with Distributed shared memory

Start with the simplest possible case. Write down what Distributed shared memory claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In computer science, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to Distributed shared memory before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about Distributed shared memory ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of Distributed shared memory

In research
Distributed shared memory appears in computer science research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses Distributed shared memory in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
Distributed shared memory is common in secondary-school and first-year university syllabi. It links to neighbouring topics Distributed computing architecture, so understanding it makes those chapters shorter.
In everyday life
Look for Distributed shared memory outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.
Ask Teacher Smith questions about this articleOpens your AI tutor with a question about “Distributed shared memory” →

How to study Distributed shared memory in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what Distributed shared memory means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain Distributed shared memory out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is Distributed shared memory in simple terms?

In computer science, distributed shared memory (DSM) is a form of memory architecture where physically separated memories can be addressed as a single shared address space. The term "shared" does not mean that there is a single centralized memory, but that the address space is shared—i.e., the same…

Why does Distributed shared memory matter?

Because it connects several computer science ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study Distributed shared memory?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on Distributed shared memory.

Tags

  • Distributed computing architecture

Keep exploring