細粒度スレッド生成をサポートする Java 処理系の構想 - Yoshihiro ...

errorhandleΛογισμικό & κατασκευή λογ/κού

18 Νοε 2013 (πριν από 3 χρόνια και 6 μήνες)

68 εμφανίσεις

Java Meets

Fine
-
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 system

realizing



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/throw

even in a bytecode level

But...

Problem

E.g., stack frame info is put into a data structure explicitly

Alternatives

to Implement Fine
-
grain Threads


Extending an existing native compiler?


Extending an existing JVM/JIT?


Writing Java source to source translator?