Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.programmer > #24095

Re: A JavaScript setTimeout() even canNOT interrupt a currently executing setTomeout() event!

From Richard Maher <maher_rjSPAMLESS@hotmail.com>
Newsgroups comp.lang.javascript, comp.lang.java.programmer
Subject Re: A JavaScript setTimeout() even canNOT interrupt a currently executing setTomeout() event!
Date 2013-05-16 19:02 +0800
Organization Aioe.org NNTP Server
Message-ID <kn2ech$ig5$1@speranza.aioe.org> (permalink)
References <kn070t$dl$1@speranza.aioe.org> <XnsA1C23366CC4eejj99@194.109.133.133>

Cross-posted to 2 groups.

Show all headers | View raw


On 5/16/2013 6:01 AM, Evertjan. wrote:
> Richard Maher wrote on 15 mei 2013 in comp.lang.javascript:
>
>> A JavaScript setTimeout() even canNOT interrupt
>> a currently executing setTimeout() event!
>
>> If, like me, you hold this truth to be self-evident ..
>
> More general, setTimeOut() does not fire while script is being executed,
> as Javascript [in browsers and probably elsewhere] at present is both
> single threaded and uninteruptable.
>
> Otherwise it just fires after the script-execution ends.
>
> Even more so, setTimeout() only executes momentarily by calling a function
> or a code string.
>
> So not so self-evident.
>

Thanks. The penny is beginning to drop, and my foolish notion of 
separate execution contexts for an "event" -vs- "mainline" in JavaScript 
sees me looking like a numpty harkening to days gone by :-(

IIUYC, once an event is executing (e.g. a setTimeout() function or 
string) then it is just another chunk of inline JavaScript that can't 
(the focus() and inline event examples notwithstanding) or won't be 
interrupted until it's run. At which time the main loop will look to the 
event queue(s) and decide what to do.

Obviously, in my case, the Java Plugin changes the ball-game but that's 
why I love it and take advantage of it!

Cheers Richard Maher

Back to comp.lang.java.programmer | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

A JavaScript setTimeout() even canNOT interrupt a currently executing setTomeout() event! Richard Maher <maher_rjSPAMLESS@hotmail.com> - 2013-05-15 22:44 +0800
  Re: A JavaScript setTimeout() even canNOT interrupt a currently executing setTomeout() event! markspace <markspace@nospam.nospam> - 2013-05-15 08:58 -0700
    Re: A JavaScript setTimeout() even canNOT interrupt a currently executing setTomeout() event! Richard Maher <maher_rjSPAMLESS@hotmail.com> - 2013-05-16 19:14 +0800
      Re: A JavaScript setTimeout() even canNOT interrupt a currently executing setTomeout() event! markspace <markspace@nospam.nospam> - 2013-05-16 07:44 -0700
  Re: A JavaScript setTimeout() even canNOT interrupt a currently executing setTomeout() event! "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2013-05-16 00:01 +0200
    Re: A JavaScript setTimeout() even canNOT interrupt a currently executing setTomeout() event! Richard Maher <maher_rjSPAMLESS@hotmail.com> - 2013-05-16 19:02 +0800

csiph-web