@@ -4,34 +4,34 @@ This program plots the Mandelbrot set and writes it out as a PNG file. It uses R
4
4
5
5
Different commits show different implementation strategies:
6
6
7
- * [ Branch ` single-threaded ` ] ( https://github.com/jorendorff/rust- mandelbrot/blob /single-threaded/src/main.rs )
7
+ * [ Branch ` single-threaded ` ] ( https://github.com/ProgrammingRust/ mandelbrot/tree /single-threaded )
8
8
is the base version of the program. It does all the work on the main
9
9
thread.
10
10
11
- * [ Branch ` bands ` ] ( https://github.com/jorendorff/rust- mandelbrot/commit /bands )
11
+ * [ Branch ` bands ` ] ( https://github.com/ProgrammingRust/ mandelbrot/tree /bands )
12
12
splits the plotting area up into eight bands, and assigns one thread
13
13
to each. This often makes poor use of the threads, because some
14
14
bands take significantly longer than others to complete: once a fast
15
15
thread completes its band, its CPU goes idle while its less
16
16
fortunate brethren are still hard at work.
17
17
18
- * [ Branch ` task-queue ` ] ( https://github.com/jorendorff/rust- mandelbrot/commit /task-queue )
18
+ * [ Branch ` task-queue ` ] ( https://github.com/ProgrammingRust/ mandelbrot/tree /task-queue )
19
19
gets an almost perfect linear speedup from its threads. It splits
20
20
the plotting area up into many more bands, and then has threads draw
21
21
bands from a common pool until the pool is empty. When a thread
22
22
finishes one band, it goes back for more work. Since the bands still
23
23
take different amounts of time to render, the problem cited above
24
24
still occurs, but on a much smaller scale.
25
25
26
- * [ Branch ` lockfree ` ] ( https://github.com/jorendorff/rust- mandelbrot/commit /lockfree )
26
+ * [ Branch ` lockfree ` ] ( https://github.com/ProgrammingRust/ mandelbrot/tree /lockfree )
27
27
uses Rust's atomic types to implement a lock-free iterator type, and
28
28
uses that to dole out bands from the pool instead of a
29
29
mutex-protected count. On Linux, this is no faster than the
30
30
mutex-based version, which isn't too surprising: on Linux, locking
31
31
and unlocking an uncontended mutex * is* simply a pair of atomic
32
32
operations.
33
33
34
- * [ Branch ` rayon ` ] ( https://github.com/jorendorff/rust- mandelbrot/commit /rayon )
34
+ * [ Branch ` rayon ` ] ( https://github.com/ProgrammingRust/ mandelbrot/tree /rayon )
35
35
uses the Rayon library instead of Crossbeam. Rayon provides a
36
36
* parallel iterator* API that makes our code much simpler. It looks
37
37
a lot like Rust code that uses plain old iterators.
0 commit comments