Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > Applet UpCall from JS Event - Which Thread?

Thread Tools

Applet UpCall from JS Event - Which Thread?

Richard Maher
Posts: n/a

With many direct references to the second lovely colour diagram on this
page: -

I completely understand the hour-glass pause on the single-JS-thread
preservation architecture when the red arrow for the additional
"applet-spawned" thread tries to call down when the applet worker thread is
already calling down. Very clever; love it! Well done all involved.

What I'd like to know (and I bet my left gonad no one here, including moi,
has the faintest idea): -

1) When the additional applet-spawned thread calls down into Javascript and
that JS calls setTimeout(myFunc,1000) and myFunc eventually [up]Calls back
into the Applet, which thread will host the call to the applet method?
Default-Worker or Applet-Spawned? Is the tenuous link/association to a
round(ish)-trip preserved?

2) What happens when a single JAVA thread is the target of affection from
multiple Javascript UpCalls? (The scenario being a) an event upCalls to JAVA
b) The Applet takes some time before returning c) The single Javascript
thread is now free to accept further events or down-calls d) a subsequent
event has triggered another UpCall request e) but the thread is
busy/occupied with the first)

Ok, if you don't know, you don't know. If you fancy a half-educated guess
then that's great as well. Either way please keep the usual "I wouldn't do
that if I were you" bullshit scowls to yourselves. The best-pratice section
says "Be as quick as you can" and "always wait an hour before swimming"
yadda, yadda, yadda. . .

I am desperately trying to pin down architected behaviour here that is the
reciprocal of the down-call throttling. Please help if you can.

Cheers Richard Maher

Reply With Quote

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Chrome selects wrong thread for JS-Java upcall on 2nd(ish) Applet instance Richard Maher Java 13 11-17-2010 10:20 AM
Applet UpCall from JS Event - Which Thread? Richard Maher Javascript 0 03-17-2010 11:15 AM
Determining the Browser and event.keyCode vs. event.which Nathan Sokalski ASP .Net 4 03-11-2006 06:36 AM
Determining the Browser and event.keyCode vs. event.which Nathan Sokalski ASP .Net Building Controls 4 03-11-2006 06:36 AM
Microcontrollers: which one ? which language ? which compiler ? The Jesus of Suburbia NZ Computing 2 02-11-2006 06:53 PM