Comparing Code Mobility in Java RMI and Distributed Shared Memory, Study notes of Computer Science

An analysis of two approaches to mobile object systems: explicit code mobility in java rmi and distributed shared memory. Code examples, explanations of the basic idea, characteristics, key issues, and challenges of each approach. The document also discusses the importance of performance and the role of memory consistency models in implementing strong consistency.

Typology: Study notes

Pre 2010

Uploaded on 08/18/2009

koofers-user-fmk
koofers-user-fmk 🇺🇸

10 documents

1 / 14

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Reflections on
Mobile Object Systems
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe

Partial preview of the text

Download Comparing Code Mobility in Java RMI and Distributed Shared Memory and more Study notes Computer Science in PDF only on Docsity!

Reflections on

Mobile Object Systems

Recent Reading …

Explicit Code Mobility in Java RMI

Alexander Ahern and Nobuko Yoshida

Imperial College, London

Ahern’s solution

Sender: int mOpt1(RemoteObject r, int a) { thunk t = freeze( int x = r.f(a); int y = r.g(a, x); int z = r.h(a, y); z ); return r.run(t); new method on r (at remote site): int run(thunk x) { return defrost(x); }

Emerald Solution

int m1(RemoteObject r, int a) { move this to r; int x = r.f(a); int y = r.g(a, x); int z = r.h(a, y); return z; }

The Basic Idea

multiple processes share a single virtual memory space
processes do loads/stores from/to memory locations
pages may be resident (local) or non-resident (remote)
  • accesses to non-resident pages generate page faults
page faults are handled by the OS and serviced by the DSM
middleware
  • perhaps by retrieving the page from another machine
protection faults can also be used by the DSM system to
intercept “interesting” references to the shared memory
  • perhaps by invalidating pages on another machine

Characteristics

  • Inter-process communication is via modification and subsequent reading of shared memory locations
  • Semantics defined by memory consistency model
  • Local and remote communication look the same
  • remote communication is hidden behind MMU faults;^ invisible to the application
  • some memory accesses take (very much) longer than others
  • analogy with cache misses on SMPs
  • Like programming a shared memory multiprocessor
  • UMA vs NUMA vs NORMA architectures

Why is Performance Hard?

  • minimum unit of communication is a page (why?)
  • two processes accessing the same page cause thrashing

… even if they are accessing different addresses (“false sharing”)

effect of page size?

Replicated Pages

  • Most DSM systems replicate pages

read-only processes can execute in parallel

only one replica can be writable

how do we choose it?
how do we invalidate/update outdated copies?
  • Cost of DSM comes from protection faults and message exchanges

Strongly influenced by caching strategy and “memory consistency model”

How can we Implement

Strong Consistency?

  1. Centralized DSM
  2. Migrating DSM
  3. Read-only replication; central server for writes
  4. Read-only replication; migrating server for writes

Did anyone ask the

Programmer?

  • Programmers who use shared memory use a high- level language with synchronization constructs!
  • Arbitrary memory sharing will get you a C-^ even if your program “works”!
  • Novel idea: ask the language implementor what abstractions help her to do her job!