Presentation is loading. Please wait.

Presentation is loading. Please wait.

List Processing in Real Time on a Serial Computer Henry G. Baker, Jr. CS395T: Hadi Esmaeilzadeh February 2009.

Similar presentations


Presentation on theme: "List Processing in Real Time on a Serial Computer Henry G. Baker, Jr. CS395T: Hadi Esmaeilzadeh February 2009."— Presentation transcript:

1 List Processing in Real Time on a Serial Computer Henry G. Baker, Jr. CS395T: Hadi Esmaeilzadeh February 2009

2 Outline List Processing and Real-Time Garbage Collection The Minsky-Feinchel-Yochelson-Cheney- Arnborg (MFYCA) Copying GC Method The Serial Real-Time (SRT) GC Method Discussion Citation Statistics

3 List Processing and Real- Time Garbage Collection Interpretation instead of compilation Significantly increases the running time Good compilers and new languages (SIMULA) Inefficient storage structure Compilers Compact list representation CDR-coding Garbage collection Trace and mark all the accessible cells Baker’s SRT System

4 Serial Real-Time GC System (Baker’s Algorithm) Time required by each of the elementary operations Bounded by a constant factor Independent of the number of live cells Pseudo real-time Based on MFYCA’s copying GC algorithm (SIMULA) Basic idea: copy a small portion during each cons rather than copying a lot infrequently Single-processor solution Space efficiency

5 MFYCA Algorithm: The Setup

6 Before Garbage Collection Flip is the first step of garbage collection.

7 MFYCA Algorithm: Copying The First Step The cells pointed by registers are the first copied cells.

8 MFYCA Algorithm: Copying the Roots Now the registers contain the forwarding addresses.

9 MFYCA Algorithm: Copying … The dashed arrows show the forwarding addresses.

10 MFYCA Algorithm: Copying … Done! The fromspace is now contains garbage.

11 MFYCA is Simple and Elegant One path algorithm instead of 3 paths of Mark Sweep Relocate No collector stack

12 Baker’s Algorithm and k Key idea: perform k iterations of GC before each allocation Both semispaces contain accessible cells User program is tricked to believe the GC is finished at the last flip time All the registers are updated right after flip New allocations are performed at the top of tospace Each car and cdr checks for a forwarding address and updates if found

13 Baker’s Algorithm: Before GC (k=2) The cells pointed to by registers are moved at the flip time.

14 Baker’s Algorithm: Copy the Roots (k=2) Both of semispaces contain live cells.

15 Baker’s Algorithm: CONSing (k=2) New nodes are allocated at the top of tospace.

16 Discussion

17 Discussion: Time-Space Trade off All operation required bounded time Independent of the number of live cells o(1) CONSing: c + k (1 + 1/k) as much storage as needed by MFCYA Trading space for time k=4 -> k=8 => 10% space saving Would we need such a mathematical analysis?

18 Discussion: Space Paper is very concerned about space (?!!) With large k’s MFYCA and SRT use the same amount of storage Max MKSMW storage <= N(1.5+2m) Max SRT storage < N(2 + 2m) Do we care about space? What do we care most about? How about embedded systems and portable devices?

19 Discussion: Unsupported Cases No bounded-time operations for Virtual memory machines !?? Array structures Copy and trace time is proportional to the length of array What about memory hierarchy and caches? How about working set size? What if the whole working set could have fit in the cache? Memory traffic Power

20 Discussion: Breadth-First Order The graph of live objects is traversed in breadth first order MFYCA and Baker Would we care? Locality

21 Discussion: Proof by Induction Incremental GC is proved to be correct by induction How important is the poof of correctness?

22 Discussion: Multi-core Era Is Baker’s algorithm extendible to multi- core systems? Most of them use coherent shared memory systems Coherence and Caching!?

23 Discussion: Imperative Languages How well Baker’s algorithm applies to operations other than the list operations? Program stack Vectors and arrays Hash tables What about imperative languages?

24 Conclusions Baker’s SRT Algorithm based on MFYCA copying GC algorithm Contributions Real-time: all operations require bounded time Serial and single threaded Space efficient and flexible Trade off between space and time (through adjusting k) Proven to be correct It doesn’t run out of space when it should not

25 Citation Statistics ACM portal: 183 Google scholar: 606 Guy E. Blelloch, Perry Cheng, On bounding time and space for multiprocessor garbage collection, ACM SIGPLAN Notices, v.39 n.4, April 2004 A. M. Cheadle, A. J. Field, S. Marlow, S. L. Peyton Jones, R. L. While, Exploring the barrier to entry: incremental generational garbage collection for Haskell, Proceedings of the 4th international symposium on Memory management, October 24-25, 2004, Vancouver, BC, Canada Andrew W. Appel, Real-time concurrent collection on stock multiprocessors, ACM SIGPLAN Notices, v.39 n.4, April 2004 David F. Bacon, Perry Cheng, David Grove, Michael Hind, V. T. Rajan, Eran Yahav, Matthias Hauswirth, Christoph M. Kirsch, Daniel Spoonhower, Martin T. Vechev, High-level real-time programming in Java, Proceedings of the 5th ACM international conference on Embedded software, September 18-22, 2005, Jersey City, NJ, USA Danny Dubé, Marc Feeley, BIT: A Very Compact Scheme System for Microcontrollers, Higher-Order and Symbolic Computation, v.18 n.3-4, p.271-298, December 2005 David Siegwart, Martin Hirzel, Improving locality with parallel hierarchical copying GC, Proceedings of the 2006 international symposium on Memory management, June 10-11, 2006, Ottawa, Ontario, Canada Sylvain Stanchina, Matthias Meyer, Mark-sweep or copying?: a "best of both worlds" algorithm and a hardware-supported real-time implementation, Proceedings of the 6th international symposium on Memory management, October 21-22, 2007, Montreal, Quebec, Canada Filip Pizlo, Erez Petrank, Bjarne Steensgaard, A study of concurrent real-time garbage collectors, ACM SIGPLAN Notices, v.43 n.6, June 2008 Wolfgang Puffitsch, Decoupled root scanning in multi-processor systems, Proceedings of the 2008 international conference on Compilers, architectures and synthesis for embedded systems, October 19-24, 2008, Atlanta, GA, USA Pascal Cuoq, Damien Doligez, Hashconsing in an incrementally garbage-collected system: a story of weak pointers and hashconsing in ocaml 3.10.2, Proceedings of the 2008 ACM SIGPLAN workshop on ML, September 21-21, 2008, Victoria, BC, Canada Wolfgang Puffitsch, Martin Schoeberl, Non-blocking root scanning for real-time garbage collection, Proceedings of the 6th international workshop on Java technologies for real-time and embedded systems, September 24-26, 2008, Santa Clara, California Filip Pizlo, Antony L. Hosking, Jan Vitek, Hierarchical real-time garbage collection, ACM SIGPLAN Notices, v.42 n.7, July 2007

26 Resources Michael Bond’s presentation in 2003 class


Download ppt "List Processing in Real Time on a Serial Computer Henry G. Baker, Jr. CS395T: Hadi Esmaeilzadeh February 2009."

Similar presentations


Ads by Google