Erlang / Erlang Basics Interview questions
What are processes in Erlang?
An Erlang process is the basic unit of concurrency — not an OS process, but a lightweight, BEAM-managed unit with its own stack, heap, and mailbox. Spawning one costs only a few hundred bytes and microseconds, so it's normal for a running system to have tens of thousands of them at once.
Processes share no memory. The only way for two of them to interact is by sending messages, which get copied into the receiver's mailbox. This isolation is what makes one process crashing harmless to everything else.
Pid = spawn(fun() -> io:format("hello from a process~n") end).
spawn/1 returns a PID immediately; the function body runs concurrently and independently
of the caller.
More Related questions...