# Interrupt \`Threads.@threads\` computation

**URL:** <https://discourse.julialang.org/t/interrupt-threads-threads-computation/71199>\
**Category:** General Usage\
**Tags:** multithreading, task, threads\
**Created:** [November 9, 2021, 10:27am UTC](https://discourse.julialang.org/t/interrupt-threads-threads-computation/71199 "2021-11-09T10:27:08Z")\
**Posts on this page:** 1\
**Showing post:** 9

<div class="post-metadata">

**Author:** ![lmiq](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/lmiq/32/18314_2.png) [@lmiq](https://discourse.julialang.org/u/lmiq)\
**Post date:** [April 24, 2023, 1:00pm UTC](https://discourse.julialang.org/t/interrupt-threads-threads-computation/71199/9 "2023-04-24T13:00:22Z")

</div>

There are other similar recent threads, for instance this one: [How to early return from inside a @threads loop - #7 by lmiq](https://discourse.julialang.org/t/how-to-early-return-from-inside-a-threads-loop/97457/7)

Personally, if the condition in the final thread is not an error, I would not use a `try` block. As in the example above, I prefer to control the tasks per thread and terminate them cleanly by using a flag (atomic or locked).

---

_[View the full topic](https://discourse.julialang.org/t/interrupt-threads-threads-computation/71199)._
