Section 8.2.4 – 8.2.7

RPC, Distributed Shared Memory & Load Balancing

Execution semantics across network boundaries, page-based memory emulation, communication-aware task placement, and distributed scheduling algorithms.

8.2.4 Remote Procedure Call (RPC) Semantics & Fault Modes

Pioneered by Birrell and Nelson (1984), Remote Procedure Call (RPC) allows programs running on one multicomputer node to invoke subroutines executing on another node transparently. While local function calls pass arguments via CPU registers or stack frames within a shared address space, RPCs must cross an unreliable network where messages can be dropped, delayed, duplicated, or reordered.

1. The 5 Fault Modes of RPC

Failure Mode Impact Recovery Strategy
Client Cannot Locate Server Binding fails; server endpoint down or unregistered. Return explicit error code or raise language runtime exception.
Lost Request Message Server never receives the call; client blocks indefinitely. Client starts a retransmission timer; resends request upon timeout.
Lost Reply Message Server executed the routine, but client never received result. Client retransmits. Server must detect duplicates via sequence numbers.
Server Crash After Execution Server completed call but rebooted before sending reply. Distinguish between At-Least-Once and At-Most-Once semantics.
Client Crash (Orphan Tasks) Server continues computing for a client that no longer exists. Orphan elimination: extermination, reincarnation epochs, or timeouts.

2. Invocation Semantics & Idempotency

Guided Walkthrough: The Complete RPC Lifecycle Stage 1 of 5

Concept Overview: This walkthrough visually tracks an RPC invocation of compute_hash(data_block) from the client application stack down to network serialization, across the wire, and through server worker execution.

Action Required: Click 'Execute Stage 1: Client Application Call' below.
The client application makes a standard local function call to compute_hash(). The call traps directly into the auto-generated Client Stub.
Client Machine (Node 0) Client Application compute_hash(data) Client Stub Awaiting invocation Kernel Transport Socket / NIC Network Fabric Wire Idle Server Machine (Node 1) Server Implementation compute_hash() worker Server Stub (Skeleton) Awaiting packet Kernel Transport Socket / NIC
Pipeline Stage: Client Call
Parameter Marshaling: Pending
Network Wire State: Idle
Server Execution: Waiting
-- Follow the instructions above to trace the complete RPC execution path --

8.2.5 Distributed Shared Memory (DSM) & Memory Consistency

While multicomputers offer superior physical scalability and lower hardware costs compared to large symmetric multiprocessors, programming them requires message-passing primitives (MPI, sockets) rather than direct variable references. Distributed Shared Memory (DSM) bridges this architectural divide by emulating a single, globally shared virtual address space across independent, physically disjoint multicomputer nodes.

1. Page-Based DSM Emulation (The Kai Li / Ivy Model)

Rather than building specialized hardware, software page-based DSM leverages the CPU's existing Memory Management Unit (MMU) and standard virtual memory page tables:

2. Memory Consistency Models: From Sequential to Release

Consistency Model Contract & Synchronization Invariant Network Overhead
Strict Consistency Any read to memory location x returns the value stored by the most recent write to x in absolute physical time. Physically impossible in distributed systems without instantaneous zero-latency communication.
Sequential Consistency All memory operations appear to execute in some sequential order that is consistent across all nodes, and operations of each individual process appear in program order. Extremely high. Every write must synchronously invalidate or update all peer copies globally before progressing.
Causal Consistency Writes that are potentially causally related must be seen by every node in the same order. Concurrent writes may be observed in different orders. Moderate. Uses vector clocks to track causal dependencies across nodes.
Release Consistency Ordinary reads and writes are strictly local and batched. Coherence messages are restricted entirely to synchronization boundaries: Acquire() and Release(). Minimal. Eliminates false sharing and ping-pong bouncing by sending compressed diffs only at synchronization points.
The Release Consistency Invariant (Munin / TreadMarks):
  • Acquire(): Tells the DSM runtime that a critical section is beginning. The local node pulls invalidation notices or updates from the lock's previous owner, refreshing stale pages before user code reads them.
  • Ordinary Stores: Memory writes inside the critical section modify local memory directly. No network messages are sent during the critical section.
  • Release(): Tells the DSM runtime that the critical section has ended. The local node computes binary diffs of modified pages and broadcasts them to subsequent acquirers.
Guided Walkthrough: Page Faulting, Replication & Release Consistency Stage 1 of 3

Concept Overview: This walkthrough visually tracks how operating systems emulate shared memory across message-passing hardware. Observe how MMU page faults trigger network page transfers, how write faults enforce single-writer ownership via invalidation, and how Release Consistency eliminates network ping-ponging.

Action Required: Click 'Execute Stage 1: Read Fault & Page Replication' below.
Initially, Page P1 resides only on Node 0. Watch Node 1 attempt a read on P1. The MMU generates a page fault, prompting the DSM runtime to fetch P1 across the network and map it as Read-Only on both nodes.
Multicomputer Node 0 Core 0 (Pipeline) PTE: P1 [Read/Write] Physical Page Frame P1 (4 KB) Data: Var X = 100, Var Y = 200 NIC 0: Idle Interconnect Fabric Multicomputer Node 1 Core 1 (Pipeline) PTE: P1 [Invalid] Unmapped Virtual Memory [No Local Copy of Page P1] NIC 1: Idle DSM State: Single Owner (Node 0 Exclusive Read/Write) Network Overhead: 0 KB/s
Node 0 Page Rights: Read/Write (Exclusive)
Node 1 Page Rights: Invalid (Fault on Access)
Consistency Policy: Sequential (Strict Faults)
False Sharing Status: None
-- DSM environment initialized. Page P1 is owned exclusively by Node 0. Click button above to step --

8.2.6 & 8.2.7 Distributed Scheduling & Dynamic Load Balancing

In a multicomputer, arrival rates across independent nodes fluctuate over time. Dynamic load balancing transfers runnable tasks from heavily loaded machines to lightly loaded machines to minimize average turnaround time.

Sender-Initiated vs. Receiver-Initiated Probing

Characteristic Sender-Initiated Probing Receiver-Initiated Probing
Initiator Heavily loaded node with excess tasks. Underloaded or idle node seeking work.
Low System Load Optimal: Probing node immediately finds an idle target. Wasteful: Many idle nodes flood network seeking rare busy nodes.
High System Load Probe Storms: Busy nodes spam probes, finding zero idle targets. Optimal: Idle node immediately finds a heavily loaded node to offload.
Guided Walkthrough: Dynamic Cluster Load Balancing Stage 1 of 3

Concept Overview: This walkthrough models task migration across a 4-node cluster. Observe how burst arrivals create extreme load imbalances, how Sender-Initiated push offloads work, and how Receiver-Initiated work stealing maintains equilibrium under high load.

Action Required: Click 'Simulate Stage 1: Burst Arrival on Node 0' below.
Inject a burst of 8 tasks onto Node 0 while Nodes 1, 2, and 3 have near-zero tasks. Watch the cluster queue imbalance develop.
Node 0 Queue: 1 Task Normal Load Node 1 Queue: 1 Task Normal Load Node 2 Queue: 0 Tasks Underloaded (Idle) Node 3 Queue: 0 Tasks Underloaded (Idle)
Cluster Balance: Stable Baseline
Active Policy: Awaiting Run
Migration Volume: 0 Tasks Moved
Cluster Efficiency: Nominal
-- Cluster ready. Follow instructions above to observe load balancing in action --