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!

Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!news.stack.nl!aioe.org!.POSTED!not-for-mail
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 Thu, 16 May 2013 19:02:41 +0800
Organization Aioe.org NNTP Server
Lines 34
Message-ID <kn2ech$ig5$1@speranza.aioe.org> (permalink)
References <kn070t$dl$1@speranza.aioe.org> <XnsA1C23366CC4eejj99@194.109.133.133>
NNTP-Posting-Host jOhPn0KFjrxwuMc9OPMmCw.user.speranza.aioe.org
Mime-Version 1.0
Content-Type text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding 7bit
X-Complaints-To abuse@aioe.org
User-Agent Mozilla/5.0 (Windows NT 6.1; rv:17.0) Gecko/20130509 Thunderbird/17.0.6
X-Notice Filtered by postfilter v. 0.8.2
Xref csiph.com comp.lang.javascript:19762 comp.lang.java.programmer:24095

Cross-posted to 2 groups.

Show key headers only | 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