Pobj “objects that last” Course Project, CS262a, Fall ‘04 Amir Kamil and Gilad Arnold.

Slides:



Advertisements
Similar presentations
Chapter 22 Implementing lists: linked implementations.
Advertisements

Pointers.
Dynamic Allocation and Linked Lists. Dynamic memory allocation in C C uses the functions malloc() and free() to implement dynamic allocation. malloc is.
Dynamic Memory Allocation in C.  What is Memory What is Memory  Memory Allocation in C Memory Allocation in C  Difference b\w static memory allocation.
Programming Languages and Paradigms The C Programming Language.
SPLINT STATIC CHECKING TOOL Sripriya Subramanian 10/29/2002.
1 Compiler Construction Intermediate Code Generation.
Memory Management Case study (JVM & CLR) KIRAN KUMAR V KIRAN KUMAR V LENIN THUMMALAPALLI LENIN THUMMALAPALLI.
1 1 Lecture 14 Java Virtual Machine Instructors: Fu-Chiung Cheng ( 鄭福炯 ) Associate Professor Computer Science & Engineering Tatung Institute of Technology.
Data Structures: A Pseudocode Approach with C
Various languages….  Could affect performance  Could affect reliability  Could affect language choice.
Chapter 1 Object Oriented Programming. OOP revolves around the concept of an objects. Objects are crated using the class definition. Programming techniques.
CS 326 Programming Languages, Concepts and Implementation Instructor: Mircea Nicolescu Lecture 18.
. Plab – Tirgul 5 pointers to pointers, libraries.
1 CSSE 332 Standard Library, Storage classes, and Make.
Java for High Performance Computing Jordi Garcia Almiñana 14 de Octubre de 1998 de la era post-internet.
. Memory Management. Memory Organization u During run time, variables can be stored in one of three “pools”  Stack  Static heap  Dynamic heap.
Java Data Types  Everything is an Object  Except Primitive Data Types  For efficiency  Platform independent  Portable  “slow”  Objects are often.
15213 C Primer 17 September Outline Overview comparison of C and Java Good evening Preprocessor Command line arguments Arrays and structures Pointers.
Introduction & Overview CS4533 from Cooper & Torczon.
File System. NET+OS 6 File System Architecture Design Goals File System Layer Design Storage Services Layer Design RAM Services Layer Design Flash Services.
Java and C++, The Difference An introduction Unit - 00.
Imperative Programming
University of Calgary – CPSC 441. C PROGRAM  Collection of functions  One function “main()” is called by the operating system as the starting function.
Chapter 6 Buffer Overflow. Buffer Overflow occurs when the program overwrites data outside the bounds of allocated memory It was one of the first exploited.
Adapted from Prof. Necula UCB CS 1641 Overview of COOL ICOM 4029 Lecture 2 ICOM 4029 Fall 2008.
Process Introspection: A Checkpoint Mechanism for High Performance Heterogeneous Distributed Systems. University of Virginia. Author: Adam J. Ferrari.
The Java Programming Language
Chapter 5: Programming Languages and Constructs by Ravi Sethi Activation Records Dolores Zage.
Comp 245 Data Structures Linked Lists. An Array Based List Usually is statically allocated; may not use memory efficiently Direct access to data; faster.
Chapter 0.2 – Pointers and Memory. Type Specifiers  const  may be initialised but not used in any subsequent assignment  common and useful  volatile.
Netprog: Java Intro1 Crash Course in Java. Netprog: Java Intro2 Why Java? Network Programming in Java is very different than in C/C++ –much more language.
Basic Semantics Associating meaning with language entities.
C++ History C++ was designed at AT&T Bell Labs by Bjarne Stroustrup in the early 80's Based on the ‘C’ programming language C++ language standardised in.
Chapter 1 Object Oriented Programming. OOP revolves around the concept of an objects. Objects are created using the class definition. Programming techniques.
C Programming in Linux Jacob Chan. C/C++ and Java  Portable  Code written in one system and works in another  But in C, there are some libraries that.
Compiler Construction Dr. Noam Rinetzky and Orr Tamir School of Computer Science Tel Aviv University
COP4020 Programming Languages Names, Scopes, and Bindings Prof. Xin Yuan.
Dynamic Memory Allocation. Domain A subset of the total domain name space. A domain represents a level of the hierarchy in the Domain Name Space, and.
1 Homework HW5 due today Review a lot of things about allocation of storage that may not have been clear when we covered them in our initial pass Introduction.
CS536 Semantic Analysis Introduction with Emphasis on Name Analysis 1.
Copyright Curt Hill Variables What are they? Why do we need them?
Topic 3: C Basics CSE 30: Computer Organization and Systems Programming Winter 2011 Prof. Ryan Kastner Dept. of Computer Science and Engineering University.
CS415 C++ Programming Takamitsu Kawai x4212 G11 CERC building WV Virtual Environments Lab West Virginia University.
12/23/2015Engineering Problem Solving with C++, second edition, J. Ingber 1 Engineering Problem Solving with C++, Etter/Ingber Chapter 9 An Introduction.
1 Lecture07: Memory Model 5/2/2012 Slides modified from Yin Lou, Cornell CS2022: Introduction to C.
Java FilesOops - Mistake Java lingoSyntax
Chapter 12: Programming in the Large By: Suraya Alias 1-1.
Spring, 2011 –– Computational Thinking – Dennis Kafura – CS 2984 Data Structures Mapping complex structures to linear memory.
CINT & Reflex – The Future CINT’s Future Layout Reflex API Work In Progress: Use Reflex to store dictionary data Smaller memory footprint First step to.
1 Recall that... char str [ 8 ]; str is the base address of the array. We say str is a pointer because its value is an address. It is a pointer constant.
Sadegh Aliakbary Sharif University of Technology Fall 2010.
MORE POINTERS Plus: Memory Allocation Heap versus Stack.
Reference Types CSE301 University of Sunderland Harry R Erwin, PhD.
 Data Type is a basic classification which identifies different types of data.  Data Types helps in: › Determining the possible values of a variable.
Creating Java Applications (Software Development Life Cycle) 1. specify the problem requirements - clarify 2. analyze the problem - Input? Processes? Output.
Announcements Remember what we talked on Tuesday in terms of Makefiles and phony targets. Don’t lose points for this! BTW, the.PHONY target can appear.
RealTimeSystems Lab Jong-Koo, Lim
Memory Management in Java Mr. Gerb Computer Science 4.
Eliminating External Fragmentation in a Non-Moving Garbage Collector for Java Author: Fridtjof Siebert, CASES 2000 Michael Sallas Object-Oriented Languages.
Pointers to pointers & multi-dimensional arrays
Dynamic Allocation Review Structure and list processing
C Primer.
C++ History C++ was designed at AT&T Bell Labs by Bjarne Stroustrup in the early 80's Based on the ‘C’ programming language C++ language standardised in.
Chap. 8 :: Subroutines and Control Abstraction
Chap. 8 :: Subroutines and Control Abstraction
Combining Compile-Time and Run-Time Components
Dynamic Memory.
ICOM 4029 Fall 2003 Lecture 2 (Adapted from Prof. Necula UCB CS 164)
15213 C Primer 17 September 2002.
Presentation transcript:

pobj “objects that last” Course Project, CS262a, Fall ‘04 Amir Kamil and Gilad Arnold

overview Persistent dynamic memory management library –memory manager independent –support for garbage collector Implemented over ARIES storage management ( lladd ) –but is generally storage independent Atomicity through transaction semantics –logical consistency in the presence of failure Automatic reconstruction and crash recovery –physical / binary compatibility of memory blocks (intra-object) –topological reconstruction of references (inter-object) Emphasis on flexibility and usability –support for legacy code / library processing –mixed persistent / transient object management –logical consistency factored out

programming with pobj Don’t mess with… files and I/O representation conversions reconstruction atomicity and crash recovery storage management and garbage collection dumping recursive data structures Node *list = NULL; void add_line (char *line) { int len = strlen (line); pobj_start (); Node *node = (Node *) pobj_malloc (sizeof (Node)); char *str = (char *) pobj_malloc (sizeof (char) * (len + 1)); pobj_ref_typify (node, node_ref_fields); strcpy (str, line); pobj_update (str); POBJ_SET_REF (node, str, str); POBJ_SET_REF (node, next, list); pobj_static_set_ref (&list, node); pobj_end (); } int main (int argc, char **argv) { pobj_init (); while (get_line (line, sizeof (line))) add_line (line); print_list (); }

persistent memory objects str next persistency header link to repository object size str next static references repositorystatic variables list ref non-ref object data native layout type info (optional) reference fields transient fields persistent objects repository str next memorybacking store

architecture application pobj libc lladd VMI/O C program pobj libc lladd VMI/O MM/GC compiler Persistent Titanium The obvious case (below) but also more interesting ones (right)…

language supported persistency Persistent objects implemented in Titanium, an SPMD Java dialect Persistency statically known through separate type hierarchy Persistent operations compiled to use pobj functions Persistent p = new PersistentString(); temp_6 = (T11nc_2R74ac *) pobj_calloc(1, sizeof (T11nc_2R74ac)); Safe operation aggregation through transaction blocks Support for persistent arrays through qualifiers int[] persistent x = new int[4] persistent; pobj integrated with Titanium’s Boehm-Weiser garbage collector tcbuild java.lang.Object java.lang.String user.Foo ti.lang.Persistent user.PersistentString user.Bar

Use… persistent objects that extend Persistent static variables to point to roots of data structures transaction blocks to maintain consistency static class Node extends Persistent {... } static Node head, tail; static void addLine (String s) { transaction { Node node = new Node(s); if (head == null) head = tail = node; else { tail.next = node; // Crash in the middle of a transaction. if (node.num == 4) throw new Error(); tail = node; } // List only built on first run. public static void main (String[] args) { String line; if (head == null) // Check if first run. while ((line = getLine ()) != null) addLine (line); printList (); } Persistent Titanium Program execution results input run #1 output run #2+ output line1 line2 line3 line4 (crash) line1 line2 line3

evaluation Different approach than RDS/RVM –topological storage and reconstruction nice abstraction for objects recursive operations: update, mark-and-sweep –independent of memory and store managers –persistent / transient allocated on a single region possibly improves spatial cache locality –but probably not as efficient (benchmarks are future work!) Some numbers…

future work Short term dynamic persistency type descriptors generalized statics transient fields fast checksum comparison Long term flexible pointers on-the-fly rollback delayed recovery (static initializers) Sci-Fi object synchronization automatic lock management (deadlock resolution) persistency semantics for Titanium/Java –persistify predefined types through qualifiers –runtime detection of persistent operations –transaction block optimization (reduce number of updates)