Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

History of JavaScript concurrency model

62 views
Skip to first unread message

oyvin...@gmail.com

unread,
Dec 3, 2013, 4:26:08 AM12/3/13
to
I was surprised to read about JavaScript's concurrency model [1] when I discovered striking similarities (or equalness?) with the internals of a scheduler I wrote for a small microcontroller in 1988 [2] (which still runs out there in tens of thousands):

<blockquote>"A JavaScript runtime contains a message queue, which is a list of messages to be processed. To each message is associated a function. When the stack is empty, a message is taken out of the queue and processed. The processing consists of calling the associated function (and thus creating an initial stack frame). The message processing ends when the stack becomes empty again." [1]</blockquote>

What is the history of JavaScript's concurrency model?

[1] - https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/EventLoop
[2] - http://www.teigfam.net/oyvind/pub/rtx-51/rtx-51.html#javascript

Øyvind Teig
Trondheim
Norway
http://www.teigfam.net/oyvind/home/technology/

Hans-Georg Michna

unread,
Dec 3, 2013, 10:02:37 AM12/3/13
to
Is it really called concurrency? To be precise, there is no
concurrence in JavaScript. It is single-threaded on
multi-processing machines.

Not sure about very modern variants though.

Hans-Georg

Christoph Michael Becker

unread,
Dec 3, 2013, 10:20:27 AM12/3/13
to
There are web workers[1], which enable some form of multi-threading.

[1] <http://en.wikipedia.org/wiki/Web_worker>

--
Christoph M. Becker

Thomas 'PointedEars' Lahn

unread,
Dec 3, 2013, 10:29:29 AM12/3/13
to
oyvin...@gmail.com wrote:

> I was surprised to read about JavaScript's concurrency model [1] […]
> [1] -
> [https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/EventLoop

| This article is in need of a technical review.

HTH

--
PointedEars

Twitter: @PointedEars2
Please do not Cc: me. / Bitte keine Kopien per E-Mail.

Thomas 'PointedEars' Lahn

unread,
Dec 3, 2013, 10:32:02 AM12/3/13
to
They are a part of the HTML5 DOM/Web Applications API, though.

Øyvind Teig

unread,
Dec 3, 2013, 4:32:55 PM12/3/13
to
Thanks! This is a general comment to all of you.

Some seem to call this "concurrency". Of course that's not the same as "parallel", so it's ok that the activities just feel concurrent. I have written some blogs about this, trying to understand "event-loop/callback/futures"-type concurrency used in (it seems JavaScript) and Scala etc. Pick any one from the top of this list: http://www.teigfam.net/oyvind/home/technology/ - and I do take comments!

I agree that that page needs a rewrite anyhow. Especially the "Never blocking" section, which needs to severely limit scope. Blocking is bad with some "process models", but even good with others. Read my blogs, they are full of that stuff.

But where are the history guys?-)

Øyvind

Øyvind Teig

unread,
Dec 4, 2013, 1:46:57 AM12/4/13
to
What's the procedure to be able to come with suggestions to the editor? Or is it just "an editor", like on Wikipedia?

kl. 16:29:29 UTC+1 tirsdag 3. desember 2013 skrev Thomas 'PointedEars' Lahn følgende:
> Øyvind teig wrote: > I was surprised to read about JavaScript's concurrency model [1] […] > [1] - > [https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/EventLoop | This article is in need of a technical review. HTH -- PointedEars Twitter: @PointedEars2 Please do not Cc: me. / Bitte keine Kopien per E-Mail.

0 new messages