JavaScript Concurrency Models: The Event Loop

Written by mozilla | Published 2021/01/14
Tech Story Tags: javascript | mozilla | mdn-documentation | concurrency | learning-to-code | programming | software-development | js-concurrency-models

TLDR JavaScript has a concurrency model based on an event loop, which is responsible for executing the code, collecting and processing events, and executing queued sub-tasks. This model is quite different from models in other languages like C and Java. Modern JavaScript engines implement and heavily optimize the described semantics. The event loop got its name because of how it's usually implemented, which usually resembles: while (queue.processNextMessage()) Each message has an associated function which gets called in order to handle the message.via the TL;DR App

no story

Written by mozilla | Mozilla (stylized as moz://a) is a free software community founded in 1998 by members of Netscape.
Published by HackerNoon on 2021/01/14