http://wiki.apidesign.org/index.php?title=Bck2BrwsrThreading&feed=atom&action=historyBck2BrwsrThreading - Revision history2024-03-28T17:00:32ZRevision history for this page on the wikiMediaWiki 1.12.0rc1http://wiki.apidesign.org/index.php?title=Bck2BrwsrThreading&diff=8117&oldid=prevJaroslavTulach: /* Milestone 4: Release */2015-01-22T09:00:50Z<p><span class="autocomment">Milestone 4: Release</span></p>
<table style="background-color: white; color:black;">
<col class='diff-marker' />
<col class='diff-content' />
<col class='diff-marker' />
<col class='diff-content' />
<tr>
<td colspan='2' style="background-color: white; color:black;">←Older revision</td>
<td colspan='2' style="background-color: white; color:black;">Revision as of 09:00, 22 January 2015</td>
</tr>
<tr><td colspan="2" class="diff-lineno">Line 40:</td>
<td colspan="2" class="diff-lineno">Line 40:</td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>== Milestone 4: Release ==</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>== Milestone 4: Release ==</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td></tr>
<tr><td class='diff-marker'>-</td><td style="background: #ffa; color:black; font-size: smaller;"><div>Wrap up the previous milestones into production quality code and release official [[Bck2Brwsr]] version with support for [[Bck2BrwsrThreading|threading]]. The challenges include finding a way to introduce the new format compatibly and not regress in performance when people don't use threads at all. Will require some new APIs for controlling the [[Bck2Brwsr]] compiler and doing packaging.</div></td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div>Wrap up the previous milestones into production quality code and release official [[Bck2Brwsr]] version with support for [[Bck2BrwsrThreading|threading]]. The challenges include finding a way to introduce the new format compatibly and not regress in performance when people don't use threads at all. Will require some new APIs for controlling the [[Bck2Brwsr]] compiler and doing <ins style="color: red; font-weight: bold; text-decoration: none;">[[Bck2BrwsrLibraries]] </ins>packaging.</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>== Milestone 5: Support for [[Java]] Concurrent. Part II. ==</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>== Milestone 5: Support for [[Java]] Concurrent. Part II. ==</div></td></tr>
</table>JaroslavTulachhttp://wiki.apidesign.org/index.php?title=Bck2BrwsrThreading&diff=8116&oldid=prevJaroslavTulach: /* Milestone 4: Release */2015-01-22T08:58:59Z<p><span class="autocomment">Milestone 4: Release</span></p>
<table style="background-color: white; color:black;">
<col class='diff-marker' />
<col class='diff-content' />
<col class='diff-marker' />
<col class='diff-content' />
<tr>
<td colspan='2' style="background-color: white; color:black;">←Older revision</td>
<td colspan='2' style="background-color: white; color:black;">Revision as of 08:58, 22 January 2015</td>
</tr>
<tr><td colspan="2" class="diff-lineno">Line 40:</td>
<td colspan="2" class="diff-lineno">Line 40:</td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>== Milestone 4: Release ==</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>== Milestone 4: Release ==</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td></tr>
<tr><td class='diff-marker'>-</td><td style="background: #ffa; color:black; font-size: smaller;"><div>Wrap up the previous milestones into production quality code and release official [[Bck2Brwsr]] version with support for [[Bck2BrwsrThreading|threading]].</div></td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div>Wrap up the previous milestones into production quality code and release official [[Bck2Brwsr]] version with support for [[Bck2BrwsrThreading|threading]]<ins style="color: red; font-weight: bold; text-decoration: none;">. The challenges include finding a way to introduce the new format compatibly and not regress in performance when people don't use threads at all. Will require some new APIs for controlling the [[Bck2Brwsr]] compiler and doing packaging</ins>.</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>== Milestone 5: Support for [[Java]] Concurrent. Part II. ==</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>== Milestone 5: Support for [[Java]] Concurrent. Part II. ==</div></td></tr>
</table>JaroslavTulachhttp://wiki.apidesign.org/index.php?title=Bck2BrwsrThreading&diff=8115&oldid=prevJaroslavTulach: /* Testing Application */2015-01-22T08:53:56Z<p><span class="autocomment">Testing Application</span></p>
<table style="background-color: white; color:black;">
<col class='diff-marker' />
<col class='diff-content' />
<col class='diff-marker' />
<col class='diff-content' />
<tr>
<td colspan='2' style="background-color: white; color:black;">←Older revision</td>
<td colspan='2' style="background-color: white; color:black;">Revision as of 08:53, 22 January 2015</td>
</tr>
<tr><td colspan="2" class="diff-lineno">Line 11:</td>
<td colspan="2" class="diff-lineno">Line 11:</td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>=== Testing Application ===</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>=== Testing Application ===</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td></tr>
<tr><td class='diff-marker'>-</td><td style="background: #ffa; color:black; font-size: smaller;"><div>Download the [http://xelfi.cz/download/ThreadingInDuke.zip sample application<del style="color: red; font-weight: bold; text-decoration: none;">]</del>]. Unzip, change directory next to the root pom.xml. Then:</div></td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div>Download the [http://xelfi.cz/download/ThreadingInDuke.zip sample application]. Unzip, change directory next to the root pom.xml. Then:</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div><source lang="bash"></div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div><source lang="bash"></div></td></tr>
</table>JaroslavTulachhttp://wiki.apidesign.org/index.php?title=Bck2BrwsrThreading&diff=8112&oldid=prevJaroslavTulach: /* Testing Application */2015-01-22T08:37:27Z<p><span class="autocomment">Testing Application</span></p>
<table style="background-color: white; color:black;">
<col class='diff-marker' />
<col class='diff-content' />
<col class='diff-marker' />
<col class='diff-content' />
<tr>
<td colspan='2' style="background-color: white; color:black;">←Older revision</td>
<td colspan='2' style="background-color: white; color:black;">Revision as of 08:37, 22 January 2015</td>
</tr>
<tr><td colspan="2" class="diff-lineno">Line 16:</td>
<td colspan="2" class="diff-lineno">Line 16:</td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div># build the code</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div># build the code</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>$ mvn clean install</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>$ mvn clean install</div></td></tr>
<tr><td class='diff-marker'>-</td><td style="background: #ffa; color:black; font-size: smaller;"><div># verify it runs in <del style="color: red; font-weight: bold; text-decoration: none;">[[</del>JavaFX<del style="color: red; font-weight: bold; text-decoration: none;">]]</del></div></td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div># verify it runs in <ins style="color: red; font-weight: bold; text-decoration: none;">real HotSpot VM (and with </ins>JavaFX<ins style="color: red; font-weight: bold; text-decoration: none;">)</ins></div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>$ mvn -f client/pom.xml exec:java</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>$ mvn -f client/pom.xml exec:java</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div># try it in a browser</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div># try it in a browser</div></td></tr>
</table>JaroslavTulachhttp://wiki.apidesign.org/index.php?title=Bck2BrwsrThreading&diff=8111&oldid=prevJaroslavTulach: /* Milestone 1: start/wait/notify */2015-01-22T08:36:48Z<p><span class="autocomment">Milestone 1: start/wait/notify</span></p>
<table style="background-color: white; color:black;">
<col class='diff-marker' />
<col class='diff-content' />
<col class='diff-marker' />
<col class='diff-content' />
<tr>
<td colspan='2' style="background-color: white; color:black;">←Older revision</td>
<td colspan='2' style="background-color: white; color:black;">Revision as of 08:36, 22 January 2015</td>
</tr>
<tr><td colspan="2" class="diff-lineno">Line 27:</td>
<td colspan="2" class="diff-lineno">Line 27:</td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>Execution in [[Bck2Brwsr]] [[VM]] throws {{JDK|java/lang|SecurityException}}.</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>Execution in [[Bck2Brwsr]] [[VM]] throws {{JDK|java/lang|SecurityException}}.</div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins style="color: red; font-weight: bold; text-decoration: none;"></ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins style="color: red; font-weight: bold; text-decoration: none;">== Milestone 2: Support for [[Java]] Concurrent. Part I. ==</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins style="color: red; font-weight: bold; text-decoration: none;"></ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins style="color: red; font-weight: bold; text-decoration: none;">Modern [[Java]] applications are using concurrent utilities (like {{JDK|java/lang/util/concurrent/locks|ReentrantLock}} and these need to be supported as well. Supporting all of them may require a bit of time, but supporting a subset should be possible and is subject of this ''part one'' milestone.</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins style="color: red; font-weight: bold; text-decoration: none;"></ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins style="color: red; font-weight: bold; text-decoration: none;">The set of classes to be supported is to be defined by the supporter(s) of the effort.</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins style="color: red; font-weight: bold; text-decoration: none;"></ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins style="color: red; font-weight: bold; text-decoration: none;">== Milestone 3: Generate Portable Code ==</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins style="color: red; font-weight: bold; text-decoration: none;"></ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins style="color: red; font-weight: bold; text-decoration: none;">Milestone one demonstrated we can generate code that runs in modern browsers (by using [[JavaScript]] 6 syntax), time to convert the code into something that can run in older browsers (like IE 9) - e.g. into [[JavaScript]] 5 or older.</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins style="color: red; font-weight: bold; text-decoration: none;"></ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins style="color: red; font-weight: bold; text-decoration: none;">== Milestone 4: Release ==</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins style="color: red; font-weight: bold; text-decoration: none;"></ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins style="color: red; font-weight: bold; text-decoration: none;">Wrap up the previous milestones into production quality code and release official [[Bck2Brwsr]] version with support for [[Bck2BrwsrThreading|threading]].</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins style="color: red; font-weight: bold; text-decoration: none;"></ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins style="color: red; font-weight: bold; text-decoration: none;">== Milestone 5: Support for [[Java]] Concurrent. Part II. ==</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins style="color: red; font-weight: bold; text-decoration: none;"></ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins style="color: red; font-weight: bold; text-decoration: none;">Implement the rest of [[Java]] concurrent utilities.</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins style="color: red; font-weight: bold; text-decoration: none;"></ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins style="color: red; font-weight: bold; text-decoration: none;">== Milestone 6: Performance ==</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins style="color: red; font-weight: bold; text-decoration: none;"></ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins style="color: red; font-weight: bold; text-decoration: none;">Address performance issues discovered in previous milestones. One of such expected issues is increased size of download caused by including concurrent classes and libraries. That should be addressed by splitting the runtime into parts and downloading only the needed ones (identified by static analysis and/or runtime needs). The other issue is potential slowdown when using threads - address that by optimizing the pieces of code known to not require threading at all and designing a way for these optimized and thread ready parts to co-exists. Take into account optimizations done by browsers to speed up the code natively.</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins style="color: red; font-weight: bold; text-decoration: none;"></ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins style="color: red; font-weight: bold; text-decoration: none;">== Milestone 7: Bugfixing ==</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins style="color: red; font-weight: bold; text-decoration: none;"></ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins style="color: red; font-weight: bold; text-decoration: none;">React to found concurrency bugs, address them and release update of [[Bck2Brwsr]] [[VM]].</ins></div></td></tr>
</table>JaroslavTulachhttp://wiki.apidesign.org/index.php?title=Bck2BrwsrThreading&diff=8110&oldid=prevJaroslavTulach at 08:13, 22 January 20152015-01-22T08:13:10Z<p></p>
<table style="background-color: white; color:black;">
<col class='diff-marker' />
<col class='diff-content' />
<col class='diff-marker' />
<col class='diff-content' />
<tr>
<td colspan='2' style="background-color: white; color:black;">←Older revision</td>
<td colspan='2' style="background-color: white; color:black;">Revision as of 08:13, 22 January 2015</td>
</tr>
<tr><td colspan="2" class="diff-lineno">Line 1:</td>
<td colspan="2" class="diff-lineno">Line 1:</td></tr>
<tr><td class='diff-marker'>-</td><td style="background: #ffa; color:black; font-size: smaller;"><div>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]] <del style="color: red; font-weight: bold; text-decoration: none;">throws </del>{{JDK|java/lang|SecurityException}}.</div></td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div>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]] <ins style="color: red; font-weight: bold; text-decoration: none;">thrown </ins>{{JDK|java/lang|SecurityException}}.</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>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.</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>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.</div></td></tr>
</table>JaroslavTulachhttp://wiki.apidesign.org/index.php?title=Bck2BrwsrThreading&diff=8109&oldid=prevJaroslavTulach: 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}}...2015-01-22T08:12:40Z<p>New page: The goal of <a href="/wiki/Bck2Brwsr" title="Bck2Brwsr">Bck2Brwsr</a> <a href="/wiki/Java" class="mw-redirect" title="Java">Java</a> virtual machine was to create small, fast, but limited <a href="/wiki/Java" class="mw-redirect" title="Java">Java</a> runtime. One of such limitations was no support for starting new {{JDK|java/lang|Thread}}...</p>
<p><b>New page</b></p><div>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}}.<br />
<br />
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.<br />
<br />
The rest of this page outlines the expected steps to get threading [[Bck2Brwsr|back to browser]] and status of their implementation.<br />
<br />
== Milestone 1: start/wait/notify ==<br />
<br />
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.<br />
<br />
=== Testing Application ===<br />
<br />
Download the [http://xelfi.cz/download/ThreadingInDuke.zip sample application]]. Unzip, change directory next to the root pom.xml. Then:<br />
<br />
<source lang="bash"><br />
# build the code<br />
$ mvn clean install<br />
# verify it runs in [[JavaFX]]<br />
$ mvn -f client/pom.xml exec:java<br />
# try it in a browser<br />
$ mvn -f client-web/pom.xml package bck2brwsr:show<br />
</source><br />
<br />
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.<br />
<br />
=== Status ===<br />
<br />
Execution in [[Bck2Brwsr]] [[VM]] throws {{JDK|java/lang|SecurityException}}.</div>JaroslavTulach