Monday, February 6, 2017

What do you call the different "threads" in JavaScript if they are not threads?

* (excludes the main "thread")

First rule of .NET and C#: Forget everything you know about locks and threads and Mutex and what not if you are not making a Windows app. At the web, the UI has one thread. Do not expect IIS to give a different thread to each session as there could be one hundred different sessions and that would then be silly. So, with that in mind, JavaScript isn't using multiple threads either. There is something running in a loop in the background that periodically checks if x, y, and z has happened to match up event causality consequences to the greater reality. My understanding is that this is how Node.js works under the hood too. Clearly there are a lot of psuedothread concerns to think about.

No comments:

Post a Comment