Q21Distributed Systems
Question
Describe the principles of Distributed Shared Memory (DSM). Explain the various consistency models used in DSM.
Answer
A massive architectural breakdown of Distributed Shared Memory (DSM). Details how DSM violently abstracts physically separated RAM banks into a single logical address space, and critically exposes the catastrophic performance penalties governed by Strict vs. Sequential Consistency Models.
Programming distributed systems using raw message passing (Sockets/MPI) is mathematically exhausting. Distributed Shared Memory (DSM) is an OS-level illusion. It mathematically fuses the physically separated RAM banks of 1,000 distinct servers into a single, massive virtual address space. A thread on Server A can literally execute x = 5, and a thread on Server B can read print(x), with the OS violently handling the catastrophic network page faults in the background.
When Server A accesses a memory page physically located on Server B, the local CPU throws a mathematical Page Fault. The distributed OS intercepts this, pauses the thread, blasts a TCP request to Server B, violently pulls a 4KB chunk of RAM across the network, caches it locally, and resumes the CPU. This allows standard multi-threaded code to run across datacenters.
Because DSM caches data locally to prevent horrific network latency, data duplication occurs. If Server A modifies x, Server B's cache is instantly mathematically invalid. The system must enforce a rigid Consistency Model to dictate EXACTLY when changes propagate.
1. Strict Consistency (Absolute Physics)
The mathematically perfect model. Any read to memory location MUST instantly return the value of the absolute most recent write to . The Reality: Due to Einstein's speed of light limitation, if Server A in New York writes to , Server B in Tokyo mathematically cannot read the change instantly. Strict consistency is physically impossible in wide-area distributed systems.
2. Sequential Consistency (The Compromise)
Instead of strict physical time, it enforces a rigid logical order. The result of any execution is the same as if the operations of all processors were executed in SOME sequential order, and the operations of each individual processor appear in the order specified by its program. It mathematically guarantees that all servers agree on the order of events, even if they see them slightly delayed.
3. Release Consistency (Elite Optimization)
Synchronizing RAM on every single instruction mathematically destroys network bandwidth. Release consistency forces the programmer to explicitly use Acquire() and Release() synchronization variables. The OS violently hoards all memory changes locally and ONLY blasts the updates across the network when the programmer mathematically executes Release(). This drastically slashes network traffic.