This presentation reviews a few of the basic issues with concurrency, and compares object oriented approaches to solving these problems with functional approaches.
17. pomiet.com @rbkeefer
Approaches
Traditional Object Oriented
Modern Functional
General Philosophy: Failure Prevention
General Philosophy: Embrace Failure
Monitor
Mutual Exclusion (Mutex)
Prioritization Algorithms
Support process death and resurrection
Support atomic functions
Fairness algorithms embedded in VM
23. pomiet.com @rbkeefer
A Few Facts
Traditional Object Oriented
Modern Functional
Bring data and behaviors together
Simulation of behavior (heuristics)
Overhead: Java threads 512 Kb / thread
Require thread pools / execution management
Shared heap
Hard limits on memory use
Separate data from behaviors
Data manipulation (algorithms)
Overhead: Elixir 512 b / process
Processes easily accessible
Individual private heap
Unbounded memory
25. pomiet.com @rbkeefer
Questions to Consider
Think Different:
Fault Tolerance:
What happens if a
dependency starts failing
slowly?
What’s the worse-scenario for
total failure?
Efficiency:
Is it possible to precompute
data?
Are you doing as little work as
possible?
Is load testing part of the
regression test suite?
Operability:
Where are the nonlinearities in
load or failure responses?
What are the capacity needs?
How does the system scale?