4 ms·
> Another aspect of D that enables parallization is the use of ranges + algorithms. Is that similar to the C++ std::algorithm execution policy features introdu
by VHRanger 9y ago
> Another aspect of D that enables parallization is the use of ranges + algorithms.
Is that similar to the C++ std::algorithm execution policy features introduced in C++17?
- nicwilson 9y agoNo. What Walter is talking about in D is if you have Foo[] foo = ...; foreach(f; foo) { f.bar.baz.quux; } and the computation is parallelisable then you can write import std.parallelism; foreach(f; parallel(foo)) { f.bar.baz.quux; } and it will parallelised across threads. I guess std.parallelism's parallel might be more analogous to an "instance" of an executor.
- VHRanger 9y agoSo that's similar to OpenMP parallel for looping?
- WalterBright 9y agoI'm not familiar with that aspect of C++17.
- nicwilson 9y agoIts the tag based dispatching for the `par` in std::sort(par,a.begin(),a.end()); to call a parallel implementation of sort on `a`.