Type Systems For Distributed Data Sharing Ben Liblit Alex AikenKathy Yelick.

Slides:



Advertisements
Similar presentations
Verification and Validation
Advertisements

D u k e S y s t e m s Time, clocks, and consistency and the JMM Jeff Chase Duke University.
Names and Bindings.
Generic programming in Java
Chapter Four Data Types Pratt 2 Data Objects A run-time grouping of one or more pieces of data in a virtual machine a container for data it can be –system.
NUMA Tuning for Java Server Applications Mustafa M. Tikir.
ECE122 L4: Creating Objects February 8, 2007 ECE 122 Engineering Problem Solving with Java Lecture 4 Creating and Using Objects.
1 Hierarchical Pointer AnalysisAmir Kamil Hierarchical Pointer Analysis for Distributed Programs Amir Kamil U.C. Berkeley December 7, 2005.
C. FlanaganSAS’04: Type Inference Against Races1 Type Inference Against Races Cormac Flanagan UC Santa Cruz Stephen N. Freund Williams College.
Type-Safe Programming in C George Necula EECS Department University of California, Berkeley.
ISBN Chapter 11 Abstract Data Types and Encapsulation Concepts.
Confined Types Encapsulation and modularity Seminar November, 2005 presented by: Guy Gueta.
Typed Memory Management in a Calculus of Capabilities David Walker (with Karl Crary and Greg Morrisett)
Java for High Performance Computing Jordi Garcia Almiñana 14 de Octubre de 1998 de la era post-internet.
Run time vs. Compile time
Catriel Beeri Pls/Winter 2004/5 environment 68  Some details of implementation As part of / extension of type-checking: Each declaration d(x) associated.
Approaches to Typing Programming Languages Robert Dewar.
1 Run time vs. Compile time The compiler must generate code to handle issues that arise at run time Representation of various data types Procedure linkage.
Lecture 1: Overview of Java. What is java? Developed by Sun Microsystems (James Gosling) A general-purpose object-oriented language Based on C/C++ Designed.
Peter Juszczyk CS 492/493 - ISGS. // Is this C# or Java? class TestApp { static void Main() { int counter = 0; counter++; } } The answer is C# - In C#
CSE341: Programming Languages Lecture 11 Type Inference Dan Grossman Winter 2013.
C++ / G4MICE Course Session 3 Introduction to Classes Pointers and References Makefiles Standard Template Library.
Evaluation of Memory Consistency Models in Titanium.
Types for Programs and Proofs Lecture 1. What are types? int, float, char, …, arrays types of procedures, functions, references, records, objects,...
Names Variables Type Checking Strong Typing Type Compatibility 1.
CSE 425: Data Types II Survey of Common Types I Records –E.g., structs in C++ –If elements are named, a record is projected into its fields (e.g., via.
SAMANVITHA RAMAYANAM 18 TH FEBRUARY 2010 CPE 691 LAYERED APPLICATION.
Algorithm Programming Bar-Ilan University תשס"ח by Moshe Fresko.
Overloading Binary Operators Two ways to overload –As a member function of a class –As a friend function As member functions –General syntax Data Structures.
Introduction and Features of Java. What is java? Developed by Sun Microsystems (James Gosling) A general-purpose object-oriented language Based on C/C++
CSE 232: C++ pointers, arrays, and references Overview of References and Pointers Often need to refer to another object –Without making a copy of the object.
Low-Level Detailed Design SAD (Soft Arch Design) Mid-level Detailed Design Low-Level Detailed Design Design Finalization Design Document.
Introduction to Object Oriented Programming CMSC 331.
CSE 425: Data Types I Data and Data Types Data may be more abstract than their representation –E.g., integer (unbounded) vs. 64-bit int (bounded) A language.
CE Operating Systems Lecture 14 Memory management.
C++ Memory Overview 4 major memory segments Key differences from Java
COP4020 Programming Languages Names, Scopes, and Bindings Prof. Xin Yuan.
C++ Programming Basic Learning Prepared By The Smartpath Information systems
ISBN Chapter 11 Abstract Data Types and Encapsulation Concepts.
Types(1). Lecture 52 Type(1)  A type is a collection of values and operations on those values. Integer type  values..., -2, -1, 0, 1, 2,...  operations.
Operating Systems Lecture 14 Segments Adapted from Operating Systems Lecture Notes, Copyright 1997 Martin C. Rinard. Zhiqing Liu School of Software Engineering.
CSE 425: Control Abstraction I Functions vs. Procedures It is useful to differentiate functions vs. procedures –Procedures have side effects but usually.
Garbage Collection and Classloading Java Garbage Collectors  Eden Space  Surviver Space  Tenured Gen  Perm Gen  Garbage Collection Notes Classloading.
Java Basics Opening Discussion zWhat did we talk about last class? zWhat are the basic constructs in the programming languages you are familiar.
ISBN Chapter 6 Data Types Pointer Types Reference Types Memory Management.
Object-Oriented Programming Chapter Chapter
Using Types to Analyze and Optimize Object-Oriented Programs By: Amer Diwan Presented By: Jess Martin, Noah Wallace, and Will von Rosenberg.
More Distributed Garbage Collection DC4 Reference Listing Distributed Mark and Sweep Tracing in Groups.
D u k e S y s t e m s Asynchronous Replicated State Machines (Causal Multicast and All That) Jeff Chase Duke University.
Computer Organization and Design Pointers, Arrays and Strings in C Montek Singh Sep 18, 2015 Lab 5 supplement.
GARBAGE COLLECTION IN AN UNCOOPERATIVE ENVIRONMENT Hans-Juergen Boehm Computer Science Dept. Rice University, Houston Mark Wieser Xerox Corporation, Palo.
Java Example Presentation of a Language. Background Conception: Java began as a language for embedded processors in consumer electronics, such as VCR,
SOEN 343 Software Design Section H Fall 2006 Dr Greg Butler
1 Lecture07: Memory Model 5/2/2012 Slides modified from Yin Lou, Cornell CS2022: Introduction to C.
How to execute Program structure Variables name, keywords, binding, scope, lifetime Data types – type system – primitives, strings, arrays, hashes – pointers/references.
1 Structure of Compilers Lexical Analyzer (scanner) Modified Source Program Parser Tokens Semantic Analysis Syntactic Structure Optimizer Code Generator.
Recap Introduction to Inheritance Inheritance in C++ IS-A Relationship Polymorphism in Inheritance Classes in Inheritance Visibility Rules Constructor.
Eliminating External Fragmentation in a Non-Moving Garbage Collector for Java Author: Fridtjof Siebert, CASES 2000 Michael Sallas Object-Oriented Languages.
Recap Resizing the Vector Push_back function Parameters passing Mechanism Primitive Arrays of Constants Multidimensional Arrays The Standard Library string.
Data Types In Text: Chapter 6.
CSE341: Programming Languages Lecture 11 Type Inference
Types for Programs and Proofs
Component Based Software Engineering
CSE341: Programming Languages Lecture 11 Type Inference
Type Systems For Distributed Data Structures
CSE341: Programming Languages Lecture 11 Type Inference
SAMANVITHA RAMAYANAM 18TH FEBRUARY 2010 CPE 691
CSE341: Programming Languages Lecture 11 Type Inference
Type Systems For Distributed Data Sharing
CSE341: Programming Languages Lecture 11 Type Inference
Presentation transcript:

Type Systems For Distributed Data Sharing Ben Liblit Alex AikenKathy Yelick

Distributed Sharing: Many Uses Data location management Cache coherence Race condition detection Program/algorithm documentation Consistency model relaxation Synchronization elimination Autonomous garbage collection Security

Distributed Memory Model Multiple machines, each with local memory Global memory is union of local memories Distinguish two types of pointers: –Local –Local points to local memory only –Global –Global points anywhere:  machine, address  –Different representations & operations

Type Grammar Boxed and unboxed values Integers, pointers, and pairs –Pairs are not assumed boxed References to boxes are either local or global

Review of Global Dereferencing: Standard Approach Unsound 5 x =  x =

Review of Global Dereferencing: Sound With Type Expansion 5 x =  x =

Type Expansion in Detail

Representation Versus Sharing Locally pointed-to data might not be private 5

Representation Versus Sharing Locally pointed-to data might not be private –Because of local / global aliasing 5 x =

Representation Versus Sharing Locally pointed-to data might not be private –Because of transitivity + pointer widening 5 y =  y =

Representation Versus Sharing Globally pointed-to data might not be shared –What if “  y” never actually happens? 5 y =

 y = Representation Versus Sharing But globally used data must be shared –If “  y” can happen, local pointer cell is shared. –What about cell containing “5”? 5 y =

Data Sharing as Types Shared data allows certain operations –Access by way of global pointer Private data allows other operations –Optimizations, GC, fast monitors, etc. Some form of polymorphism is essential –Neither subsumes the other –But we can have a common supertype

Augmented Type Grammar Allow subtyping of pointers, pairs –But not across pointers, since we allow assignment Allocation is explicitly shared or private Question: what can you do with mixed data?

Late Enforcement: Limited Use of Global Pointers

Late Enforcement: Applicability Data location management Cache coherence Race condition detection Program/algorithm documentation Consistency model relaxation Synchronization elimination  Autonomous garbage collection (in practice)  Security

Why Garbage Collection Breaks 1.Send out global pointer to my private data 2.Destroy all my local pointers to it 3.GC locally unreachable private data 4.… 5.Get that global pointer back again later 6.It points to my data, so coerce to local 7.Use this local pointer to my private data

Slightly Earlier Enforcement: No Escape of Private Addresses Note that τ′ might reference private data Autonomous garbage collection: OK  Security: not OK

Early Enforcement: Shared is Transitively Closed

Recap of Enforcement Strategies Late enforcement –Anything can point to anything –Restricted global dereference & assignment 5 y = 3

Recap of Enforcement Strategies Slightly earlier enforcement –Can only reveal shared addresses –Still restrict global pointer operations 5 y = 3

Recap of Enforcement Strategies Early enforcement –Shared universe is transitively closed –Global pointer restrictions trivially satisfied 5 y = 3

Type Inference: Constraint Generation Type structure already known –Including local / global Induce constraints on sharing qualifiers δ = sharedfrom global deref / assign δ ≤ δ′from assignments δ = δ′from various other operations Stricter enforcement adds more constraints δ = shared  δ′ = shared

Type Inference: Constraint Resolution Given constraints: private ≤ δ 1 δ ≤ δ 1 shared ≤ δ 2 δ ≤ δ 2 privatesharedδ δ1δ1 δ2δ2

Type Inference: Constraint Resolution Two “minimal” solutions δ = shared  δ 1 = mixed  δ 2 = shared privatesharedδ = shared δ 1 = mixedδ 2 = shared

Type Inference: Constraint Resolution Two “minimal” solutions δ = shared  δ 1 = mixed  δ 2 = shared δ = private  δ 1 = private  δ 2 = mixed privatesharedδ = private δ 1 = privateδ 2 = mixed

Type Inference: Biased Constraint Resolution 1.Push “shared” and “mixed” forward privatesharedδ δ1δ1 shared ≤ δ 2

Type Inference: Biased Constraint Resolution 1.Push “shared” and “mixed” forward 2.Identify qualifiers which cannot be private privatesharedδ δ1δ1 shared ≤ δ 2

Type Inference: Biased Constraint Resolution 1.Push “shared” and “mixed” forward 2.Identify qualifiers which cannot be private 3.Set all other qualifiers to private privatesharedδ = private δ 1 = privateshared ≤ δ 2

Type Inference: Biased Constraint Resolution 2.Identify qualifiers which cannot be private 3.Set all other qualifiers to private 4.Push “private” forward privatesharedδ = private δ 1 = private shared ≤ δ 2 private ≤ δ 2

Type Inference: Biased Constraint Resolution 3.Set all other qualifiers to private 4.Push “private” forward 5.Set remaining qualifiers to “shared” or “mixed” privatesharedδ = private δ 1 = privateδ 2 = mixed

Implementation For Titanium Java + extensions –Objects, classes, interfaces, methods –Multidimensional arrays, templates –Local / global, communications primitives Sharing validation as type checking Sharing inference as compiler analysis –Late or early enforcement –Whole-program or partial

Experimental Findings: Static Metrics How much data is “private”? –16% - 75% of all static declaration sites –46% overall; 50% on largest benchmark Is “mixed” really needed? –Up to 6% of static sites, but large impact –Some utility code: could use parametric poly

Experimental Findings: Static Metrics Why have “local shared”? –24% - 53% of shared data is locally addressed –Bad idea to force these to global Does enforcement policy affect results? –No change for small benchmarks (<1000 lines) –1% - 4% shift for larger codes

Experimental Findings: Consistency Model Relaxation Impose sequentially consistent semantics –Restrict both Titanium & C optimizers –Relax restrictions for private data Performance impact varies widely –Negligible sequential slowdown: nothing to do –Sequential slowdown, offset by inference –Sequential slowdown, better inference needed

Experimental Findings: Other Dynamic Metrics Data location management –1% - 100% of allocated bytes are private 45% in gas benchmark –amr : highly sensitive to enforcement policy 74% late / 19% early Synchronization elimination –Statically, one third eliminated –Dynamically, not significant for these codes

Summary “Shared” might not mean what you think –Related to local/global, but not the same –Different degrees of privacy to choose from Escape analysis, or several weaker alternatives –Generalizes on earlier language designs Experimental implementation –Ideas & algorithms scale to real system –More aggressive clients needed –Potential for stronger (phase-aware) inference