-
Book Overview & Buying
-
Table Of Contents
Rust for C++ Developers
By :
While the number of multithreading techniques in software development can probably fill multiple books, Rust specifically supports some especially powerful ones. In this section, we will look at a handful of specific techniques that work in Rust and are well-supported across the standard library and crate ecosystem.
In the C++ ecosystem, libraries such as OpenMP, Microsoft's concurrency runtime ConCRT, and Intel's Thread Building Blocks allow us to implement parallel versions of the normal C++ for loop. In a parallel loop, the processing of each iteration of the loop is pushed to a thread pool for execution. When the loop ends, all threads are joined. When it's safe to use this construct, it can produce significant program speedups and introduce multithreading optimizations in a way that's very accessible to most programmers.
In Rust, we can make use of something similar built on top of...