liveBook · Manning

JavaScript runtime

As explained in Grokking Concurrency

A runtime environment is the software and system context that provides services for executing programs on a computing architecture.

Imagine a workshop where a manager directs each request to the right worker. A runtime plays a similar role for programs: it provides services and helps coordinate execution rather than leaving every application to manage hardware itself. An operating system is one example of a runtime system. section 3.4

The runtime sits between an application’s design and the hardware carrying it out. It can arrange when tasks run, while an operating system also provides interfaces for services such as writing to a disk. Concurrency does not necessarily mean tasks execute in parallel: a runtime can interleave them on one processor core. section 1.4 section 6.10

Several tasks, one process

A Python example starts five child threads alongside its main thread; the reported thread count rises from one to six. It illustrates why a programmer can describe separate tasks without assigning each one directly to hardware. This example does not describe JavaScript’s execution model. section 4.8 section 4.0

Scheduling is helpful, not magical. When tasks share resources, their execution order can contribute to inconsistent updates or deadlocks. The supplied evidence explains runtimes and concurrency generally, but does not establish JavaScript-specific runtime components or behavior. section 13.1

How Grokking Concurrency covers it

How deep it goes
Explains operating-system services and multitasking conceptually, but does not detail a JavaScript runtime or its internals.
Examples
Uses a workshop manager analogy and a Python program that starts five child threads.
What it assumes
Builds from application, hardware, and operating-system roles without assuming prior knowledge of concurrency.
What you can do after
Evaluate/understand how a runtime coordinates concurrent tasks without assuming concurrency guarantees parallel execution.
How it connects
Links runtime systems to operating systems, hardware, processes, threads, scheduling, and concurrency.

Also explained in

Compare how 4 books explain JavaScript runtime →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Grokking Concurrency. The section links point to the parts of the book it draws on.