Applet UpCall from JS Event - Which Thread?

Discussion in 'Javascript' started by Richard Maher, Mar 17, 2010.

  1. Hi,

    With many direct references to the second lovely colour diagram on this
    page: -
    http://java.sun.com/javase/6/docs/technotes/guides/jweb/applet/applet_execution.html

    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
     
    Richard Maher, Mar 17, 2010
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Nathan Sokalski
    Replies:
    4
    Views:
    4,261
    Nathan Sokalski
    Mar 11, 2006
  2. Replies:
    0
    Views:
    583
  3. Richard Maher
    Replies:
    0
    Views:
    321
    Richard Maher
    Mar 17, 2010
  4. Richard Maher
    Replies:
    13
    Views:
    1,348
    Richard Maher
    Nov 17, 2010
  5. Nathan Sokalski

    Determining the Browser and event.keyCode vs. event.which

    Nathan Sokalski, Mar 10, 2006, in forum: ASP .Net Building Controls
    Replies:
    4
    Views:
    191
    Nathan Sokalski
    Mar 11, 2006
Loading...

Share This Page