Presentation is loading. Please wait.

Presentation is loading. Please wait.

Object-Oriented Implementation of Reconciliations M.Sc. Seminar Talk by Costa Shapiro under supervision of Prof. Shmuel Katz Computer Science – Technion.

Similar presentations


Presentation on theme: "Object-Oriented Implementation of Reconciliations M.Sc. Seminar Talk by Costa Shapiro under supervision of Prof. Shmuel Katz Computer Science – Technion."— Presentation transcript:

1 Object-Oriented Implementation of Reconciliations M.Sc. Seminar Talk by Costa Shapiro under supervision of Prof. Shmuel Katz Computer Science – Technion

2 29.01.2003Reconciliations in OOP2 Introduction Concurrency implies information exchange Convenient communication via data sharing Various data sharing models and issues Reconciliations as a new approach Variables have “ local ” versions for each process An operation on those versions to compute a “ global ” agreed version and distribute it Means of control over participation of a particular version in such operations

3 29.01.2003Reconciliations in OOP3 Outline Background Java Concurrency Support Shared Memory Models Concept And Programming Technique Reconciled Fields Reconcilable Classes Language Extension And Usage Patterns And Samples Implementation Notes

4 29.01.2003Reconciliations in OOP4 Java Concurrency Support Java ’ s integrated multithreading support Threads share the machine ’ s main memory Built-in concurrent data access management and thread synchronization using monitors Mutual exclusion language constructs Suspension-notification mechanism Flexible shared memory consistency model with a set of rules for synchronization

5 29.01.2003Reconciliations in OOP5 Shared Memory Models Linearizability & sequential consistency Relaxed sequential consistency Weaker rules for greater efficiency Hybrid memory consistency models Additional (synchronization) operations Java ’ s shared memory model “ Regular ” variables (weaker rules) “ Volatile ” variables (stricter rules) Implicit synchronization operations

6 29.01.2003Reconciliations in OOP6 Reconciled Fields Either a new kind of instance variables Occasionally assigned an agreed “ class-wide ” value calculated separately Can be guarded against such changes Or a new kind of class variables Having temporarily different “ working ” copies Can be forced to get updated Declared specially (in the extended language) Can be seen as an additional (customizable) memory model for Java

7 29.01.2003Reconciliations in OOP7 Reconciler A::x x Hidden Mechanism Reconciled Fields (cont.) class A reconciled x Reconciled Field Temporarily Detached a 2 x a 1 x Field Instance a 3 x Class Instance

8 29.01.2003Reconciliations in OOP8 Reconcilable Classes Reconcilability is a new addition to the possible class capabilities Only reconcilable classes can be used to declare reconciled fields Semantics of being reconcilable is identified by implementation of a special interface Reconciliation mechanism has a default implementation that should be overridden Means of iteration over the working copies A “ lightweight ” precondition procedure

9 29.01.2003Reconciliations in OOP9 class X (reconcilable) reconciliation Reconciliation Override A::x Reconciler x reconciliation Reconcilable Classes (cont.) class A reconciled X x a 2 x x 2 a 1 x x 1 a 3 x x 3 Field Value

10 29.01.2003Reconciliations in OOP10 Java Language Extension Reconciled fields: syntax Variable declaration (a new reconciled modifier) Variable “ anti-reconciliation ” guard options (a new localized statement and a method modifier) Reconciled fields: semantics Initialization (of “ master and working copies ” ) Reference, modification and assignment “ Localization ” and “ globalization ” procedures Reconciliations are as-if-atomic and independent

11 29.01.2003Reconciliations in OOP11 Java Platform Changes A new javax.reconciliation package An Object class – replaces the java.lang.Object class and contains reconciliation-related methods A Reconcilable interface – serves to identify the semantics of being reconcilable if implemented A NotReconciledException class – thrown if a non-reconciled variable encountered Some hidden (system) classes An optional javax.reconciliation.util package contains utility framework

12 29.01.2003Reconciliations in OOP12 Application Patterns Customizable high-level caching An arbitrary memory model can be realized Distributed computation result reconciling Independent computational agents are “ improving ” some global result Weak and strong updates Defer updates while performing work “ locally ” Authorized commitment Changes to some global data entity are reviewed by some authority prior to commitment

13 29.01.2003Reconciliations in OOP13 Sample The globalize method suspends the caller until a reconciliation of the field occurs The reconcile method calculates the reconciled value (and updates this object) public class NetNode { public Date currentTime() { clock.globalize(); return clock.getTime(); } private reconciled LocalClock clk = new LocalClock(); }

14 29.01.2003Reconciliations in OOP14 Sample (cont.) public class LocalClock implements Reconcilable { public localized void tick(long ticks) { localTime += ticks; } protected boolean reconcile(Collection c) { Iterator i = c.iterator(); while (i.hasNext()) { LocalClock lc = (LocalClock)i.next(); if (lc.localTime > localTime) localTime = lc.localTime; } return true; }

15 29.01.2003Reconciliations in OOP15 Implementation Architecture Reconciliation-Enabled Java Source Code Decorated Java Source Code Intermediate Java Class Binary Standardized Java Source Code Java Class BinaryAuxiliary Java Binary Preprocess Stage I Preprocess Stage II Compilation Stage I Compilation Stage II Extended Platform BinaryJVM Runtime

16 29.01.2003Reconciliations in OOP16 System Framework The straightforward academic implementation is based on two new platform classes javax.reconciliation.Object class Serves as a new root of the class hierarchy Has globalize methods & a reconciliation default Contains “ hidden ” system fields and methods javax.reconciliation.Reconciler abstract “ hidden ” system class Reconciliation mechanism (synchronization, registration, etc) is implemented as its subclass

17 29.01.2003Reconciliations in OOP17 x.globalize(); rx.globalize(); rx a 2 x a 3 x a 1 x Sample Runtime x 2 x 1 x 3 localized (x) { x =...; rx.globalize(); localized (x) { x.globalize();x.foo(); x.globalize(); }

18 29.01.2003Reconciliations in OOP18 Summary A new object-oriented software engineering technique targeting common concurrent systems design issues and employing a programming language extension is proposed The new technique is based on the reconciliations idea – a customizable shared memory consistency model An academic implementation of the language extension has been built and working examples are supplied


Download ppt "Object-Oriented Implementation of Reconciliations M.Sc. Seminar Talk by Costa Shapiro under supervision of Prof. Shmuel Katz Computer Science – Technion."

Similar presentations


Ads by Google