Remember the ASCII Mandelbrot renderer from Chapter 6, Advanced Use of STL algorithms? In this recipe, we will make it use threads in order to speed its calculation time a bit up.
First, we will modify the line in the original program that limits the number of iterations for every selected coordinate. This will make the program slower and its results more accurate than we can actually display on the terminal, but then we have a nice example target for parallelization.
Then, we will apply minor modifications to the program and see how the whole program runs faster. After those modifications, the program runs with std::async and std::future. In order to fully understand this recipe, it is crucial to understand the original program.