Java Hibernation Package is an experimental implementation of thread (de)serialization mechanism based on the Java Platform Debugger Archtecture(JPDA). You can capture snapshots of execution at any time. Then you can resume the execution later from one of them.
Ability of externalizing computation (and back) enables us to make systems fault-tolerant(via checkpointing), or to balance loads in distributed computing systems. In the context of Java, such ability corresponds to the one of thread (de)serialization, which is not inherent in standard Java runtime systems.
So far, several thread (de)serialization systems are proposed. Some implemented it by modifying existing virtual machine implementations, or reimplementing Thread-related classes through JNI. And some achieved it by way of source code (or bytecode) tranformations. However, it is not an easy task to maintain the modified version of JVM or classes, following state-of-the-art JVM implementations. Also it is almost impossible to implement (de)serialization of (possibly multiple) threads without performance penalty by the code transformation-only approach.
The project's choice is similar to the one of Illmann et al. [5th International Conference on Mobile Agents, 2001]. By making use of JPDA, we can easily capture necessary state (such as program counter, heap, and call stacks) and pack them into ordinary Java objects. Moreover, if you use Sun's recent HotSpot VMs, state capture will not affect the performance of nomal executions due to the dynamic de-optimisation technique. On the other hand, resuming execution from any given state is not directly supported even by recent JVMs. We need some bytecode engeneering in cooperation with analysis of operand stack type (also done by bytecode verification) to achieve that.
Bootup
' in the Java Hibernation Package.
PState
', then dumped to a file by the standard serialization mechanism.
PState
objects is transcribed to the VM via JDI.
hacked_sys | hacked versions of system classes (hibernation system will generate more, if necessary) |
jdfa | contains scripts and a patch to build Data-Flow Analysis Framework for Java(jDFA) for our package |
mobilesocket | contains build scripts and a patch to build MobileSocket for our package |
script | python scripts to utilize the package |
src | the source tree |
test | several test programs |
default_bcel_path
' and 'default_jdi_path
' correctly.
cd test/loop | ||
make | . . . | build test application |
make hibernate | . . . | test application starts, then hibernates in several seconds |
make dump | . . . | captured state is shown |
make resume-hibernate | . . . | test application resumes, then hibernates again in several seconds |
make resume | . . . | test application resumes |
This project was derived from a part of a research entitled 'Ubiquitous Programming Language System' by the author. It was carried out as an individual research of the PRESTO program ( Information and Systems) by Japan Science and Technology Agency.