# Debugging with threads

**URL:** <https://discourse.julialang.org/t/debugging-with-threads/93281>\
**Category:** VS Code\
**Created:** [January 20, 2023, 8:37pm UTC](https://discourse.julialang.org/t/debugging-with-threads/93281 "2023-01-20T20:37:09Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ross\_Boylan](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ross_boylan/32/9210_2.png) [@Ross\_Boylan](https://discourse.julialang.org/u/Ross_Boylan)\
**Post date:** [January 20, 2023, 8:37pm UTC](https://discourse.julialang.org/t/debugging-with-threads/93281/1 "2023-01-20T20:37:10Z")

</div>

I have code which spawns some threads with `tasks = [Threads.@spawn worker(command, ml, ev) for i in 1:nT]`. I put a breakpoint inside the `worker()` function using `VSCode` and started a higher level function with `@enter` from the `julia` console within `VSCode`. But the debugger never stops at the breakpoint, even though the code runs to completion.

I speculate that the debugger is not active in threads.

Is there anyway I can debug stuff that happens outside my main thread?

BTW, the code blocks if I try to run it all in one thread; there are ways around that for testing, but it would be convenient if the debugger worked for threads.

---

<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:** [January 20, 2023, 10:04pm UTC](https://discourse.julialang.org/t/debugging-with-threads/93281/2 "2023-01-20T22:04:18Z")

</div>

This is just not implemented. The first step would be [Support for debugging tasks · Issue #413 · JuliaDebug/JuliaInterpreter.jl · GitHub](https://github.com/JuliaDebug/JuliaInterpreter.jl/issues/413), and then we would have to make the debugger thread safe 🙂
