Distributed Shared Memory Using The NET Framework Thomas

Distributed Shared Memory Using The. NET Framework Thomas Seidmann Department of Computer Science and Engineering Faculty of Electrical Engineering and Information Technology Slovak University of Technology seidmann@dcs. elf. stuba. sk http: //www. cdot. ch/thomas/

Building distributed applications with. NET (1) • • (lower-level) socket programming. NET Remoting Middleware for distributed objects Web Services Concentration on RPC-style client/server relationship • Remote access to shared objects (methods, properties) provided by a server (UDDI, manual discovery)

Node 1 Server Node 2

Building distributed applications with. NET (2) • Desired scenario: peer. NET applications collaborate on a set of shared objects • Replication of objects • Local access to methods (and properties) • Provide the notion of objects shared among peer. NET applications • Semantics of an object based DSM (Distributed Shared Memory) – coherence!

Node 1 Node 3 coherence protocol Node 2 Node 4

Consistency model and coherence protocol • • • Causal consistency model Multiple Reader Multiple Writer (MRMW) Write-update protocol Multicast transfer of diffs between nodes Causality relationship achieved by vector logical clocks - Associative array of pairs (PID, value) • Shared object identification with a GUID

DSM Implementation Outline • Mechanism for obtaining the state of a shared object • Registration of every change of a shared object in a local storage • Listening to changes made by remote nodes and to object state queries

DSM Implementation Outline • Mechanism for obtaining the state of a shared object serialization • Registration of every change of a shared object in a local storage interception • Listening to changes made by remote nodes and to object state queries coherence thread
![Serialization, Interception • [serializable] • • • Binary serialization formatter Transparent. Proxy Real. Proxy Serialization, Interception • [serializable] • • • Binary serialization formatter Transparent. Proxy Real. Proxy](http://slidetodoc.com/presentation_image_h2/e7df76619bdeb84690bd46f99c091572/image-9.jpg)
Serialization, Interception • [serializable] • • • Binary serialization formatter Transparent. Proxy Real. Proxy DSMProxy Method Entry: object diff storage cheched Method Exit: diff calculated; if nonzero, then added with the vector logical clock value to the storage

Coherence Thread • Accesses object diff storage and the shared object via its DSMProxy • Performs state changes according to remote write update messages • Sends write update messages • Requests other nodes to send write update messages (new shared object, timeout)

DSM Implementation Overview

Multicast Channel Service • Object diffs transported with. NET Remoting • Built-in channels are TCP-based • IP-Multicast uses UDP as transport protocol • Udp. Channel, Implements IChannel

Programming Model for Shared Objects (1) • Descendant of Context. Bound. Object • Must be serializable • Annotated with Proxy. Attribute specifying Mcast. DSMProxy • (State-Modifying public methods annoted with Mcast. DSM. Modifies. State. Attribute)

Programming Model for Shared Objects (2) using System; System. Runtime. Remoting. Proxies; Mcast. DSM; [Proxy(DSMProxy)] [serializable] public class My. Shared. Object : Context. Bound. Object, IShared. Object { private Guid my. Guid = null; public Guid. Prop { get {return my. Guid; } set {my. Guid = value; } } public int my. Method(string) { //. . . do something with string return 0; } }

Programming Model for Shared Objects (3) using using System; System. Runtime. Remoting. Channels; Mcast. DSM. Channels; public class App { public static int Main(string[] args) { Channel. Services. Register. Channel ( new Udp. Channel()); // Create an instance of a // My. Shared. Object class My. Shared. Object my. Obj = new My. Shared. Object; my. Obj. Guid. Prop = "478280 B 9 -874 E-4795 -B 3 C 7 -05 CFDD 96 CD 2 C"; my. Obj. my. Method("Hello World"); return 0; } }

Conclusions • 100% managed code, compatible with Rotor • Tested with well-known scientific applications (FFT-3 D, Barnes Hut) • LAN environment, simulated loss of messages (trafic shaping with Free. BSD) • First focus on TRANSPARENCY • Comfortable programming model

Future Work • Second focus is on PERFORMANCE (diff calculation, message throughput) • Trade-off between transparency and performance • Other serialization formatters are being considered (SOAP) – might provide better diffs • SOAP together with XML aware compression (XMill)?

Thank you very much for your attention http: //www. cdot. ch/thomas/
- Slides: 18