'. '

Bck2BrwsrThreading

From APIDesign

(Difference between revisions)
Jump to: navigation, search
(New page: The goal of Bck2Brwsr Java virtual machine was to create small, fast, but limited Java runtime. One of such limitations was no support for starting new {{JDK|java/lang|Thread}}...)
Line 1: Line 1:
-
The goal of [[Bck2Brwsr]] [[Java]] virtual machine was to create small, fast, but limited [[Java]] runtime. One of such limitations was no support for starting new {{JDK|java/lang|Thread}}s - when attempted the [[VM]] throws {{JDK|java/lang|SecurityException}}.
+
The goal of [[Bck2Brwsr]] [[Java]] virtual machine was to create small, fast, but limited [[Java]] runtime. One of such limitations was no support for starting new {{JDK|java/lang|Thread}}s - when attempted the [[VM]] thrown {{JDK|java/lang|SecurityException}}.
However many people expressed interest (like [https://java.net/bugzilla/show_bug.cgi?id=6539 issue 6539]) in having full threads with classical [[Java]] semantics supported. In general it is possible, just it requires more complicated and slower code to be generated. Anyway, if there is a support, it is worth to try it.
However many people expressed interest (like [https://java.net/bugzilla/show_bug.cgi?id=6539 issue 6539]) in having full threads with classical [[Java]] semantics supported. In general it is possible, just it requires more complicated and slower code to be generated. Anyway, if there is a support, it is worth to try it.

Revision as of 08:13, 22 January 2015

The goal of Bck2Brwsr Java virtual machine was to create small, fast, but limited Java runtime. One of such limitations was no support for starting new Threads - when attempted the VM thrown SecurityException.

However many people expressed interest (like issue 6539) in having full threads with classical Java semantics supported. In general it is possible, just it requires more complicated and slower code to be generated. Anyway, if there is a support, it is worth to try it.

The rest of this page outlines the expected steps to get threading back to browser and status of their implementation.

Milestone 1: start/wait/notify

The goal is to get the basic Java threading primitives running. We need a sample application that will start multiple threads do some communication between them. We need to verify its behavior in real HotSpot VM. Then let's modify the Bck2Brwsr VM to execute the code in a browser and behave the same.

Testing Application

Download the sample application]. Unzip, change directory next to the root pom.xml. Then:

# build the code
$ mvn clean install
# verify it runs in [[JavaFX]]
$ mvn -f client/pom.xml exec:java
# try it in a browser
$ mvn -f client-web/pom.xml package bck2brwsr:show

Once the behavior of the JavaFX version is the same as the one running in modern browsers (Firefox 34.0, Chrome 39), we know this milestone is successfully finished.

Status

Execution in Bck2Brwsr VM throws SecurityException.

Personal tools
buy