Re:Comparing Parallel Rust and C++
by exDM69 on Friday November 08, 2019 @07:57AM
(#21481779)
It's not obvious how the hypothetical OpenMP for Rust should work. If you'd put #pragma omp parallel for in front of a loop, there would be no compile time guarantees of memory safety or freedom from data races.
OpenMP is suitable for the most simplest kind of parallelism in the first place.
If you look at the example code here, there's like 5 lines of pretty simple Rayon code that's almost a drop-in replacement for single threaded iterator code. It performs almost as good as the OpenMP C++ code, and it's guaranteed to be safe.
OpenMP is suitable for the most simplest kind of parallelism in the first place.
If you look at the example code here, there's like 5 lines of pretty simple Rayon code that's almost a drop-in replacement for single threaded iterator code. It performs almost as good as the OpenMP C++ code, and it's guaranteed to be safe.