Re:Comparing Parallel Rust and C++
by imtringued on Thursday November 07, 2019 @06:57PM
(#21478750)
From what I have read Rust users don't seem to care about OpenMP at all. Some even go as far to say that they would prefer using something like a Rayon alternative for C++ instead.
[ Parent
| on HN ]
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.