- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - OpenVMS
- >
- LiveConnect Applet Architecture Bug with Thread ut...
Operating System - OpenVMS
1753781
Members
7529
Online
108799
Solutions
Forums
Categories
Company
Local Language
back
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Discussions
back
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-20-2010 04:50 PM
11-20-2010 04:50 PM
LiveConnect Applet Architecture Bug with Thread utilization (with SSCCE!)
Hi,
Not sure if Bojan still responds here or if anyone else might be able to help but I make no claim to being either a Javascript or JAVA expert so, before logging a bug report with SUN/Oracle, I would appreciate those here with relevant skills casting a critical eye of my small reproducer to see if the anomalies can be explained as simple pilot error rather than a bug in the plugin code.
To reproduce the example locally, save the three text files attached to the filenames and extensions specified. Then: -
javac -cp "c:\Program Files\Java\jdk1.6.0_22\jre\lib\plugin.jar" OutThread.java
javac -cp ".;c:\Program Files\Java\jdk1.6.0_22\jre\lib\plugin.jar" Sleeper.java
jar -cf Sleeper2.jar Sleeper.class OutThread.class
NB* The above specified the classpath so as to match my version and Windows location of the relevant bits from the SDK. Your OS, Java Version and SDK path may vary or may already be defined.
Once you have compiled the two classes into the JAR, copy Sleeper2.jar and dyntest_embed.html to your web root directory. Pull up http://127.0.0.1/dyntest_embed.html with your FireBug/DeveloperTools Console window enabled and your JAVA console enabled and watch what happens. It can take up to 30,000 iterations or as little as 100 but you will see the "hang". (If you become impatient you can add further tabs with the same page (work the static vars) or load the browser instance and/or machine)
What I observe and accuse the plugin of doing is allocating the wrong work to the wrong thread. That is, unlike the documented behaviour that can be seen at: -
http://download.oracle.com/javase/6/docs/technotes/guides/jweb/applet/applet_execution.html#threads
I believe that something makes the plugin lose track of the Thread pool and allocate the setBack()/notifyAll() call to the LiveConnect worker thread (when it should go to "Fred") and horror of horrors, my consumer thread
"Fred" that should be exclusively processing jobs on the queue sometimes is allocated producer work (getNum()) which leads to an unavoidable deadlock :-(
Actual example output: -
[1]in getNum() 2490 caller [TO3] Thread Applet 1 LiveConnect Worker ThreadThread[Applet 1 LiveConnect Worker Thread,4,http://127.0.0.1/-threadGroup] hash 19c0bd6
[1]Queueing work
[1]Going for wait
**[2]in getNum() 2409 caller [TO2] Thread
FredThread[Fred,4,http://127.0.0.1/threadGroup] hash 1827d1**
[2]Queueing work
[2]Going for wait
This can be observed with FF and/or IE8 (Chrome doesn't seem to fail with only one tab but with multiple dyntest_embed.html tabs the results can be reproduced).
Does it coincide with garbage collection? Is the code/logic fundamentally flawed? Is it a LiveConnect Thread management bug in desperate need of correction?
Cheers Richard Maher
Not sure if Bojan still responds here or if anyone else might be able to help but I make no claim to being either a Javascript or JAVA expert so, before logging a bug report with SUN/Oracle, I would appreciate those here with relevant skills casting a critical eye of my small reproducer to see if the anomalies can be explained as simple pilot error rather than a bug in the plugin code.
To reproduce the example locally, save the three text files attached to the filenames and extensions specified. Then: -
javac -cp "c:\Program Files\Java\jdk1.6.0_22\jre\lib\plugin.jar" OutThread.java
javac -cp ".;c:\Program Files\Java\jdk1.6.0_22\jre\lib\plugin.jar" Sleeper.java
jar -cf Sleeper2.jar Sleeper.class OutThread.class
NB* The above specified the classpath so as to match my version and Windows location of the relevant bits from the SDK. Your OS, Java Version and SDK path may vary or may already be defined.
Once you have compiled the two classes into the JAR, copy Sleeper2.jar and dyntest_embed.html to your web root directory. Pull up http://127.0.0.1/dyntest_embed.html with your FireBug/DeveloperTools Console window enabled and your JAVA console enabled and watch what happens. It can take up to 30,000 iterations or as little as 100 but you will see the "hang". (If you become impatient you can add further tabs with the same page (work the static vars) or load the browser instance and/or machine)
What I observe and accuse the plugin of doing is allocating the wrong work to the wrong thread. That is, unlike the documented behaviour that can be seen at: -
http://download.oracle.com/javase/6/docs/technotes/guides/jweb/applet/applet_execution.html#threads
I believe that something makes the plugin lose track of the Thread pool and allocate the setBack()/notifyAll() call to the LiveConnect worker thread (when it should go to "Fred") and horror of horrors, my consumer thread
"Fred" that should be exclusively processing jobs on the queue sometimes is allocated producer work (getNum()) which leads to an unavoidable deadlock :-(
Actual example output: -
[1]in getNum() 2490 caller [TO3] Thread Applet 1 LiveConnect Worker ThreadThread[Applet 1 LiveConnect Worker Thread,4,http://127.0.0.1/-threadGroup] hash 19c0bd6
[1]Queueing work
[1]Going for wait
**[2]in getNum() 2409 caller [TO2] Thread
FredThread[Fred,4,http://127.0.0.1/threadGroup] hash 1827d1**
[2]Queueing work
[2]Going for wait
This can be observed with FF and/or IE8 (Chrome doesn't seem to fail with only one tab but with multiple dyntest_embed.html tabs the results can be reproduced).
Does it coincide with garbage collection? Is the code/logic fundamentally flawed? Is it a LiveConnect Thread management bug in desperate need of correction?
Cheers Richard Maher
1 REPLY 1
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-24-2010 01:07 AM
11-24-2010 01:07 AM
Re: LiveConnect Applet Architecture Bug with Thread utilization (with SSCCE!)
Ok, I've created a bug report for this on SDN: -
http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=7001755.
At priority 4 I'm not going to hold my breath but if you can spare 5 minutes could you please vote for a resolution to this bug via: -
http://bugs.sun.com/bugdatabase/addVote.do?bug_id=7001755.
I don't understand why more people are not anxious of the debilitating effects of this bug.
Cheers Richard Maher
http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=7001755.
At priority 4 I'm not going to hold my breath but if you can spare 5 minutes could you please vote for a resolution to this bug via: -
http://bugs.sun.com/bugdatabase/addVote.do?bug_id=7001755.
I don't understand why more people are not anxious of the debilitating effects of this bug.
Cheers Richard Maher
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
News and Events
Support
© Copyright 2024 Hewlett Packard Enterprise Development LP