All posts

Do BEAM/Elixir processes provide concurrency or enable parallelism?

For a refresher on Elixir processes

If an application is concurrent that means it has the ability to make progress on more than one task at the same time.

If an application provides parallelism that means it can execute/process multiple things at the same time.

Before multi-core processes were created the BEAM VM enabled concurrency but not parallelism. The reason here is because you could not employ multiple schedulers to process tasks in the queue at the same time, but the single scheduler was able to make progress on more than one task at a time due to the nature of its processing. The scheduler takes one process from the process queue, works on it for less than a millisecond, and then puts that process back in the queue and works on another process. This queue mechanism enables concurrency.

Once multi-core processors were created you could deploy multiple schedulers, one per core. Now each scheduler can operator on a process at the same time, thus enabling parallelism.

More Elixir process posts: Processes for web programmers, Let it crash explained, Processes in phoenix, Process module cheatsheet

Other useful resources: