Subj : Threading in JavaScript To : comp.lang.javascript,netscape.public.mozilla.jseng From : Gordan Date : Sat Feb 01 2003 01:32 pm Hi! I am aguessing that I am probably expecting WAY too much from JavaScript implementations here, but I'll ask anyway... ;-) Is there any way to achieve _actual_ threading in JS? I know that in theory, setTimeout("myFunction(myParams)", Timeout); SHOULD fork a new thread to execute myFunction(myParams), but I have found that it doesn't happen quite like that. On both IE6 and Mozilla 1.2.1 the execution is SCHEDULED for NO LESS than Timeout miliseconds in the future. This, however, doesn't GUARANTEE when the execution will begin. What happens instead is that all setTimeout() started functions are scheduled in the future and execute sequentially, one after another. They do not interleave their execution. I know that implementing safe threading is difficult, and that it opens a whole new can of worms as far as variable locking/sharing is concerned, but is such a feature present in ANY DOM compliant browser today? Is it even planned in ANY of the browsers? I would really like to avoid the path of Java applets and ActiveX controls if at all possible. TIA. Gordan .