Bck2BrwsrThreading
From APIDesign
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.