Reputation: 636
I like the feature in Java, where you can suspend just one thread and keep the other threads running. In particular in Netbeans there is a pause button next to each thread in the Debugging window. Clicking that button suspends (breaks into) that particular thread. You can then debug and step through the code. But all the other threads keep running undisturbed.
This is especially useful if you have threads which communicate with the outside world (hardware, network, etc.). And you don't want to disturb them, so there are no timeouts on the other side.
Is this also possible in Visual Studio (e.g. 2013)? So far it seems to me that when I pause the program (or a breakpoint is hit), that all threads are stopped and that there is no way to let some threads running while debugging the code of that single thread.
I know there is a freeze function, which halts one thread while the others keep running. Although useful, it is by far not the same thing. Because I can not single step through that thread or inspect some variables. I can only do that when I hit "Break All". But that will stop all threads. I am probably just missing something?
Upvotes: 6
Views: 2600
Reputation: 2857
Here's what I did:
Now, Visual Studio will only step through the thawed thread. It seems to be much slower when doing this, presumably because it has to loop through all of the frozen threads, but it brought some sanity to my multi-threaded debugging.
Upvotes: 3