# Problem with \`@reduce\` of \`FLoops\`; data race?

**URL:** <https://discourse.julialang.org/t/problem-with-reduce-of-floops-data-race/65410>\
**Category:** New to Julia\
**Tags:** package\
**Created:** [July 28, 2021, 3:49am UTC](https://discourse.julialang.org/t/problem-with-reduce-of-floops-data-race/65410 "2021-07-28T03:49:41Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![tkf](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tkf/32/17635_2.png) [@tkf](https://discourse.julialang.org/u/tkf)\
**Post date:** [July 28, 2021, 4:01am UTC](https://discourse.julialang.org/t/problem-with-reduce-of-floops-data-race/65410/2 "2021-07-28T04:01:41Z")

</div>

You’d need to use `@floop ThreadedEx() for` and then use `aa += bb` (no `@reduce`). For this code, you can also just use `Threads.@threads for`.

This is not the intended pattern for `@reduce` but it’d be nicer to give less cryptic results. I need to debug this.

FYI: `@floop for` without `@reduce` defaults to single-thread because of some historical API. I probably should stop doing this.

---

_[View the full topic](https://discourse.julialang.org/t/problem-with-reduce-of-floops-data-race/65410)._
