Chapter 12Concurrent Programming
Writing concurrent programs is easy once we know sequential
Erlang. All we need are three new primitives:
spawn, send, and
receive. spawn creates a parallel
process. send sends a message to a process, and
receive receives messages.
Erlang concurrency is based on processes. These are small, self-contained virtual machines that can evaluate Erlang functions.
I’m sure you’ve met processes before, but only in the context of operating systems. In Erlang, processes belong to the programming language and not the operating system. This means that Erlang processes will have the same logical behavior on any operating system, so we can write portable concurrent code that can run on any operating system that supports ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access