you are viewing a single comment's thread
view the rest of the comments
[–] 3 points 2 years ago (1 child)

Technically this is also possible with for loops, like with OpenMP

  • source
  • parent
  • hideshow 2 child comments
  • [–] 3 points 2 years ago (1 child)

    Imperative for loops have no guarantee at all that iterations could be executed in parallel.

    You can do some (usually expensive, and never complete) analysis to find some cases, but smart compilers tend to work the best the dumbest you need them to be. Having a loop that you can just blindly parallelize will some times lead to it being parallel in practice, while having a loop where a PhD knows how to decide if you can parallelize will lead to sequential programs in practice.

  • source
  • parent
  • hideshow 2 child comments