Java Meets Fine-grain Multithreading Yoshihiro Oyama Kenjiro Taura Akinori Yonezawa...
-
Upload
robert-logan -
Category
Documents
-
view
216 -
download
0
Transcript of Java Meets Fine-grain Multithreading Yoshihiro Oyama Kenjiro Taura Akinori Yonezawa...
Java MeetsFine-grain Multithreading
Yoshihiro Oyama
Kenjiro Taura
Akinori Yonezawa{oyama,tau,yonezawa}@is.s.u-tokyo.ac.jp
University of Tokyo
Goal
We are planning to implement Java systemrealizing
Thread creation with very very low cost High scalability
Sample Program
class Pfib { public static int pfib(int n) { if (n < 2) return 1; else { int x, y; sync { fork { x = pfib(n-1); } fork { y = pfib(n-2); } } return x + y; } }}
Synchronization block
Thread creation
Prototype Implemented
On top of the Extensible Java PreProcessor Kit EPP (by Y. Ichisugi in ETL, Japan) Java source to source translation one fork ⇔ one Java thread creation Only 500-line EPP code
Its performance is out of the question
How to Implement?Q: How can we reduce thread creation cost?
A: Lazy Task Creation (LTC) technique seems useful
Traditional compilers based on LTC: Stack is managed tricky by compilers and/or runtimes
Java allows to manipulate stack only with call/return/throweven in a bytecode level
But...
Problem
E.g., stack frame info is put into a data structure explicitly
Alternativesto Implement Fine-grain Threads
Extending an existing native compiler? Extending an existing JVM/JIT? Writing Java source to source translator?