liveBook · Manning

Process-level isolation

As explained in Elixir in Action, Third Edition

Process isolation is the separation of processes so that they do not share mutable memory and failures in one do not directly corrupt another.

Process-level isolation separates concurrent BEAM processes so they share no memory and a crash in one does not directly corrupt another. This turns concurrency into a practical fault-tolerance mechanism: failures can be confined while most of the system continues operating. section 5.1 section 8.0

The isolation model provides several operational benefits:

  • Limits an unhandled exception to one process or a small related group instead of taking down unrelated request handlers, jobs, or the server. section 5.1 section 8.0
  • Prevents crashed processes from leaving shared memory garbage that corrupts another process. section 8.2
  • Runs many lightweight VM-managed processes inside one OS process, with schedulers distributing execution across available CPU cores. section 5.1
  • Requires explicit failure detection and recovery because clients cannot use services provided by a process that has stopped. section 8.2

A crashing process leaves another process running

One spawned process starts a second process, then raises an exception. The second process still prints its completion message, and the interactive shell continues running. In a to-do system, the same boundary lets one to-do server fail without stopping other lists or cached reads. section 8.2

Temporary workers preserve broader availability

A demand-started to-do server can use GenServer with restart: :temporary. A crash stops that worker without restarting it or causing repeated child failures to take down the wider cache; the next use starts it again. section 9.2.4

Figure 5.1 BEAM as a single OS process, using a few threads to schedule a large number of processes
CH05_F01_Juric3

Visualizes one BEAM OS process using a few scheduler threads to run a large number of isolated processes. section 5.1

How Elixir in Action, Third Edition covers it

How deep it goes
Explains memory separation, crash boundaries, VM scheduling, service dependencies, and supervision trade-offs.
Examples
Demonstrates spawned-process failure, isolated to-do servers, cached reads, and temporary worker restart behavior.
What it assumes
Assumes concurrent-process concepts and develops isolation through BEAM examples rather than shared-memory concurrency.
What you can do after
Apply process isolation with spawned processes, GenServer workers, and supervision strategies to limit failure effects.
How it connects
Connects concurrency with fault tolerance, supervision, GenServer workers, schedulers, and failure recovery.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Elixir in Action, Third Edition. The section links point to the parts of the book it draws on.