Re: execution order of actions
Available news archives: comp.lang.tcl - comp.lang.python - comp.security.firewalls - sci.crypt - comp.lang.php - comp.lang.javascript
Google
 
Web news.hping.org


comp.lang.javascript archive

Re: execution order of actions

From: VK <schools_ring@yahoo.com>
Date: Tue Nov 15 2005 - 06:11:53 CET

Randy Webb wrote:
> VK said the following on 11/14/2005 11:23 PM:
> > Matt Kruse wrote:
> >
> >>f1();
> >>f2();
> >>
> >>will always be executed one after the other. There is never a chance that f2
> >>will be executed before f1 exits.
> >
> >
> > Where did you get this very... *strange* idea?
>
> Probably from reality.
> Have you tried testing it?
>
> function f1(){
> var k = 0;
> for (i=0;i<100000;i++){
> k++
> }
> alert('finished f1()')
> }
>
> function f2(){
> alert('finished f2()')
> }
>
> f1();
> f2();

Waht kind of reality is that and what does it have to do with the
<synchronized> issue? Did you try:

function f1() {
 f2()
}

function f2() {
 // doing something quicklier
 // or faster than f1
}

P.S. Just knocked on me that this is that Matt - AJAX library inventor.
I would suggest then to read asap about *piper* input / output streams
in Java - why are they, how are they implemented and how could one
mimic them in JavaScript. That would solve a great amount of the
reported/incoming instability issues.
Received on Mon Nov 21 03:29:34 2005