<HTML><BODY style="word-wrap: break-word; -khtml-nbsp-mode: space; -khtml-line-break: after-white-space; ">I think that you can get an extra thread when you do a request, but I'm not entirely certain.<DIV><BR class="khtml-block-placeholder"></DIV><DIV>The way jowles was designed was that it was event based with a timer to run the function that queries the server for events.  I used the setTimeout() function to effectively put the main loop to sleep until a new event or timeout expiry occurred.</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>But anyway... my point is... even if we are single threaded, the functions that modify the client data are supposed to complete their execution quickly. So... yeah... I think the lack of "true" threading in Javascript is a PITA, but I think we can work around it without too much distress.</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>That being said, the whole thing is a hack, and the "real" solution would have been to embed something like Ruby or Python (or even Smalltalk) into both the browser and server.</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>-Cheers</DIV><DIV>-Matt H.</DIV><DIV><BR><DIV><DIV>On Apr 17, 2007, at 7:43 AM, Peter A Trotter wrote:</DIV><BR class="Apple-interchange-newline"><BLOCKQUOTE type="cite">Hopefully not wading in half cocked here but...<BR><BR>AFAIK non of the major web browsers implement threading for their javascript engines, or at least not within a single window. Hence when your asynchronous call returns it does not get executed until the current javascript thread terminates. Obviously this is unacceptable on the desktop but in terms of web apps it seems the right thing to do. That said javascript should only be used to enable the interface - we shouldn't be using it for any long execution stuff. <BR><BR>-Pete<BR><BR><DIV><SPAN class="gmail_quote">On 17/04/07, <B class="gmail_sendername">Tim Newsom</B> &lt;<A href="mailto:cephdon@gmail.com">cephdon@gmail.com</A>&gt; wrote:</SPAN><BLOCKQUOTE class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"> <BR>On Tue, 17 Apr 2007 3:54, Alexander E Genaud wrote:<BR>&gt; Tim,<BR>&gt;<BR>&gt; I believe Microsoft created the non-standard XMLHttpRequest object<BR>&gt; through Active X around IE 5 but it has become something of a standard <BR>&gt; implemented by Firefox, Safari/Konquerer, Opera, and perhaps others.<BR>&gt; I've been using a nice wrapper, Sarissa, successfully for a few years<BR>&gt; in many environments.<BR>&gt;<BR>&gt; <A href="http://dev.abiss.gr/sarissa/"> http://dev.abiss.gr/sarissa/</A><BR>&gt;<BR>&gt; I believe the asynchronous flag is implemented in those major<BR>&gt; browsers. Alternatively, you can create an HttpConnection "class" with<BR>&gt; it's own timeout, abort, polling (4K), threading, etc. While the <BR>&gt; details are different across browsers, it seems that threads never<BR>&gt; context switches unless explicitly asked to do so (such as Timeouts<BR>&gt; and alert dialogs). In other words, a "ring" might come in, but if you <BR>&gt; are calculating the Fibonacci numbers to the umpteenth power, the<BR>&gt; "ring" thread probably won't alert you in good time. I believe that is<BR>&gt; true regardless of the async flag.<BR>&gt;<BR> &gt; Alex<BR><BR>Alex,<BR><BR>Hmm, that's interesting... It seems like a poor implementation if you<BR>can't guarantee that the event will fire asynchronously.  Why offer it<BR>at all?  Strange.<BR><BR>--Tim<BR><BR> _______________________________________________<BR>OpenMoko community mailing list<BR><A href="mailto:community@lists.openmoko.org">community@lists.openmoko.org</A><BR><A href="http://lists.openmoko.org/mailman/listinfo/community"> http://lists.openmoko.org/mailman/listinfo/community</A><BR></BLOCKQUOTE></DIV><BR><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">_______________________________________________</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">OpenMoko community mailing list</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><A href="mailto:community@lists.openmoko.org">community@lists.openmoko.org</A></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><A href="http://lists.openmoko.org/mailman/listinfo/community">http://lists.openmoko.org/mailman/listinfo/community</A></DIV> </BLOCKQUOTE></DIV><BR></DIV></BODY></HTML>