r/javascript • • Oct 29 '10

c# programmer: JavaScript is "completely single threaded and blocking" in relation to fetching from a URL.

/r/programming/comments/dxv7a/asynchrony_in_c_5_part_one/c13rj6k
0 Upvotes

26 comments sorted by

View all comments

8

u/adelle Oct 29 '10

This:

Javascript is only non blocking in situations where you are dispatching off to the browser do to something. In that situation, the browser is spawning a XmlHttpRequest on a separate thread.

I can do the same thing in VB6 using WinHTTP. It doesn't make VB6 multithreaded. Even the callback is executed on the same thread as I started on.

However, you cannot do this in your own code. There is no way to take an arbitrary task and run it asynchronously without blocking.

This is why there is the WebWorkers spec for HTML5.

5

u/[deleted] Oct 29 '10

The funny thing is how angry Not_Edward_Bernays is about this.