# How to debug a multithreaded code in VS code?

**URL:** <https://discourse.julialang.org/t/how-to-debug-a-multithreaded-code-in-vs-code/96078>\
**Category:** General Usage\
**Tags:** question\
**Created:** [March 14, 2023, 6:46pm UTC](https://discourse.julialang.org/t/how-to-debug-a-multithreaded-code-in-vs-code/96078 "2023-03-14T18:46:53Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Amro](https://avatars.discourse-cdn.com/v4/letter/a/4491bb/32.png) [@Amro](https://discourse.julialang.org/u/Amro)\
**Post date:** [March 14, 2023, 6:46pm UTC](https://discourse.julialang.org/t/how-to-debug-a-multithreaded-code-in-vs-code/96078/1 "2023-03-14T18:46:53Z")

</div>

I am using VS code with Julia extension. I debug the code normally by putting breakpoints at specific locations. However, putting these breakpoints inside `@threads` macro with a for loop (or inside a multithreaded code with parallelization directive) will not let the debug stops at them. Any way to solve it?

---

<div class="post-metadata">

**Author:** ![davidanthoff](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/davidanthoff/32/223493_2.png) [@davidanthoff](https://discourse.julialang.org/u/davidanthoff)\
**Post date:** [March 15, 2023, 5:22pm UTC](https://discourse.julialang.org/t/how-to-debug-a-multithreaded-code-in-vs-code/96078/2 "2023-03-15T17:22:21Z")

</div>

That is not supported at the moment. I think a first step to enabling this would be a solution for [Support for debugging tasks · Issue #413 · JuliaDebug/JuliaInterpreter.jl · GitHub](https://github.com/JuliaDebug/JuliaInterpreter.jl/issues/413), and then there would be a ton of additional work that we would have to do 🙂

---

<div class="post-metadata">

**Author:** ![Amro](https://avatars.discourse-cdn.com/v4/letter/a/4491bb/32.png) [@Amro](https://discourse.julialang.org/u/Amro)\
**Post date:** [March 15, 2023, 5:28pm UTC](https://discourse.julialang.org/t/how-to-debug-a-multithreaded-code-in-vs-code/96078/3 "2023-03-15T17:28:32Z")

</div>

Thanks for your feedback. It is true that this is needed.

- Is there another IDE that supports Julia debugging with multithread?
- Or what the people do for Julia debugging with multithread?

---

<div class="post-metadata">

**Author:** ![davidanthoff](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/davidanthoff/32/223493_2.png) [@davidanthoff](https://discourse.julialang.org/u/davidanthoff)\
**Post date:** [March 16, 2023, 11:33pm UTC](https://discourse.julialang.org/t/how-to-debug-a-multithreaded-code-in-vs-code/96078/4 "2023-03-16T23:33:41Z")

</div>

> [@Amro](#):
>
> Is there another IDE that supports Julia debugging with multithread?

The feature is really lacking in JuliaInterpreter.jl, which is the underlying debugging engine that both VS Code and Debugger.jl use. I’m not aware of any other semi-feature complete debugging solution for Julia.
