What are Elixir processes?
Answer
Elixir processes are the basic unit of concurrency — extremely lightweight, isolated actors running on the BEAM. They are not OS threads or OS processes. Key properties: Lightweight: start with ~2KB heap, grow as needed. Millions can run concurrently. Isolated: each process has its own memory heap. No shared mutable state. Communication: processes communicate only by sending immutable messages. Independent GC: each process is garbage collected independently — no global GC pauses. Create a process: pid = spawn(fn -> IO.puts("Hello") end). Send a message: send(pid, {:hello, "world"}). Receive: receive do {:hello, msg} -> IO.puts(msg) end. Processes can be linked (failure propagates) or monitored (failure sends a message). This model makes building concurrent systems composable and predictable compared to shared-memory threading.