# @threads in for loop and push! in if statement

**URL:** <https://discourse.julialang.org/t/threads-in-for-loop-and-push-in-if-statement/124916>\
**Category:** Performance\
**Tags:** threads, push\
**Created:** [January 19, 2025, 11:17am UTC](https://discourse.julialang.org/t/threads-in-for-loop-and-push-in-if-statement/124916 "2025-01-19T11:17:55Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![Eliassj](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/eliassj/32/204117_2.png) [@Eliassj](https://discourse.julialang.org/u/Eliassj)\
**Post date:** [January 19, 2025, 12:08pm UTC](https://discourse.julialang.org/t/threads-in-for-loop-and-push-in-if-statement/124916/2 "2025-01-19T12:08:14Z")

</div>

It would be helpful if you could post a single-threaded example of what you want to do instead of the chat-GPT answer. Would this solve your problem: [Thread-safe array building - #2 by yuyichao](https://discourse.julialang.org/t/thread-safe-array-building/3275/2) ?

---

_[View the full topic](https://discourse.julialang.org/t/threads-in-for-loop-and-push-in-if-statement/124916)._
