structure overview motivation design i mplementation
play

Structure Overview & Motivation Design I mplementation - PowerPoint PPT Presentation

I mplementation and Optimization of Thread-Local Variables for a Race-Free Java Dialect Yi Zhang , Clark Verbrugge McGill University Structure Overview & Motivation Design I mplementation Experiments Conclusion & Future Work


  1. I mplementation and Optimization of Thread-Local Variables for a Race-Free Java Dialect Yi Zhang , Clark Verbrugge McGill University

  2. Structure Overview & Motivation Design I mplementation Experiments Conclusion & Future Work

  3. Overview implement and optimize thread local access a new semantic for Java race-free version of Java

  4. Motivation data-race free property Complexity in racy program hard to validate the optimization many optimizations are prohibited

  5. Motivation thread-local access data are thread local by default and use shared directives for shared data ThreadLocal class in Java API

  6. Design ThreadLocal Original Design objects as wrapper ThreadLocal objects as wrapper access data: get(), set()

  7. Design Original Design each thread holds a ThreadLocalMap First, get map from thread Second, < ThreadLocal as key, value>

  8. Design Our Design thread-local the default option use “ volatile ” to specify the shared data

  9. Design thread-local the default option Our Design

  10. use “ volatile ” to specify Design the shared data Our Design accesses of data

  11. Design Original New semantic thread-local is not inherent thread-local is inherent with in semantics need support from ThreadLocal class data map searching � static: table look-up based access approach � non-static: normal access without overhead initial � fixed initial value � inherent initial value from value parents � manually and statically � automatically and at run-time

  12. Implementation Thread Local Accesses at the start of thread, make local copy all reachable reference objects if that field is not volatile Class.staticField this.field shared with all shared with threads parent threads we do this through deep-copying

  13. static fields

  14. objects reachable from static fields

  15. from parent thread objects reachable

  16. Implementation

  17. static fields Implementation

  18. Implementation objects reachable from static fields

  19. Implementation objects reachable from non-static fields

  20. Implementation

  21. Implementation

  22. Implementation

  23. Implementation

  24. Implementation

  25. Implementation

  26. Implementation table look-up based mechanism to speed up global table local table local table A.sharedItem A.localItem A.localItem Object copy for Object copy for Object thread 1 thread 2

  27. Experiments Implementation Environment: JikesRVM 3.1.1 Micro Benchmarks: Reads and writes operations on thread-local static field

  28. Micro Benchmarks Experiments

  29. Micro Benchmarks Experiments

  30. Experiments Micro Benchmarks gc time of new design increases faster !! We need special garbage collector adapted to our dialect

  31. Micro Benchmarks Experiments

  32. Experiments Non-trivial Benchmarks: Producer/ Consumer (P/ C) Sun Java Tutorial: traffic, roller coaster Sable Research Group: Doug Lea: bank Java Grande Forum Benchmark Suite: series SPECJVM98: mtrt

  33. Experiments Non-trivial Benchmarks most benchmarks shows comparable performance traffic benchmarks runs considerably slower 289 threads-> too many

  34. Conclusion & Future Work Conclusion Data-Race-Free thread-local data VS shared data thread-local and Java Virtual Machine

  35. Conclusion & Future Work Future Work Improve performance of current design reduce the copying overhead reduce gc time Full data-race-free language design

  36. Thank You!

Recommend


More recommend