This document discusses parallel programming in Elixir. It explains that Elixir uses lightweight processes to enable concurrency and communication between processes uses message passing. It describes key Elixir mechanisms including processes, spawning processes, process identifiers (PIDs), OTP, GenServers, Supervisors, and Applications. It provides examples of how to use GenServers and Supervisors and defines what an Elixir Application is. Finally, it introduces the Exstreme library for building and running computational graphs in Elixir.
4. PROCESSES
▸ Processes are the fundamental unit of concurrency in Elixir
▸ The Erlang VM supports up to 134 million of processes
▸ Lightweight processes
▸ Each actor is a process
▸ Each process performs a specific task
▸ Sends messages to communicate with the process
▸ The processes don’t share information
6. PID
▸ Identifies a process in the EVM
▸ To send a message must point the pid
7. OTP
▸ The Erlang interpreter and compiler
▸ Erlang standard libraries
▸ Dialyzer, a static analysis tool
▸ Mnesia, a distributed database
▸ Erlang Term Storage (ETS), an in-memory database
▸ A debugger,
▸ An event tracer
▸ A release management tool
8. OTP BEHAVIOURS
▸ GenServer A behaviour module for implementing the
server of a client-server relation.
▸ Supervisor A behaviour module for implementing
supervision functionality
▸ Application A module for working with applications and
defining application callbacks.
9. GEN SERVER - MODULE CALLS
▸ GenServer.start_link/3
▸ GenServer.call/3
▸ GenServer.cast/2
19. APPLICATION
▸ Component implementing some specific functionality, that
can be started and stopped as a unit, and which can be re-
used in other systems
▸ Defines a supervision tree that must be started and
stopped when the application starts and stops
▸ The start callback should return {:ok, pid}