# How to code faster parallel for loop

**URL:** <https://discourse.julialang.org/t/how-to-code-faster-parallel-for-loop/19760>\
**Category:** New to Julia\
**Tags:** parallel\
**Created:** [January 17, 2019, 8:27pm UTC](https://discourse.julialang.org/t/how-to-code-faster-parallel-for-loop/19760 "2019-01-17T20:27:16Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![bennedich](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/bennedich/32/4894_2.png) [@bennedich](https://discourse.julialang.org/u/bennedich)\
**Post date:** [January 17, 2019, 9:33pm UTC](https://discourse.julialang.org/t/how-to-code-faster-parallel-for-loop/19760/3 "2019-01-17T21:33:23Z")

</div>

See my response and sample code for a somewhat [similar problem here](https://discourse.julialang.org/t/how-to-speed-up-this-simple-code-multithreading-simd-inbounds/19681/26).

Also note that IMO this is the wrong end to approach multithreading. For several reasons, I’d rather recommend multithreading on as coarse of a level as possible, not in tight loops and individual functions like this.

(With some exceptions, for example if your problem solely consists of multiplying a single large matrix with a vector.)

---

_[View the full topic](https://discourse.julialang.org/t/how-to-code-faster-parallel-for-loop/19760)._
