% Rust Concurrency - Generating the Mandelbrot Set % Ian Channing https://github.com/ianchanning/mandelbrot % March 10, 2021
Based on the Concurrency section of Chapter 2 (A Tour of Rust)
from the O'Reilly "Programming Rust" book.
Extra concurrency algorithms from https://github.com/ProgrammingRust/mandelbrot
Rust.
Complex numbers and iterating complex numbers.
The Mandelbrot set.
Generating the Mandelbrot set with one processor.
The required changes to use multiple processors.
Fearless concurrency.
For experienced parallel programmers - faster development
For inexperienced - can gain the benefits without the danger
Immutable - no problem
Mutable within one function - no problem
Passing mutable values between functions - enforced rules
A simpler, but very similar iteration
We can do the same for complex numbers
Addition
Multiplication
An easy way to generate fractals
Complex number
Iterate
For some values of
Those are 'in' the Mandelbrot Set
Flatten out the 2D image into one very long array
Parallel thinking
Switch to parallel code with little changes
Mutexs - dangerous in other languages but safe in Rust
Specialised parallel constructs