Debugging multi-threaded code C #: Is it possible to join one thread and save the rest?

I like the function in Java, where you can pause only one thread and save the rest of the threads. In particular, Netbeans has a pause button next to each thread in the Debug window. Pressing this button pauses (breaks) this particular stream. Then you can debug and execute the code. But all other threads continue to work without problems.

This is especially useful if you have threads that communicate with the outside world (hardware, network, etc.). And you don’t want to bother 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 breakpoint is hit), all threads stop and that there is no way to allow some threads when debugging the code of this single thread.

I know there is a freeze function that stops one thread while others continue to work. Although this is useful, it is far from the same. Because I can not skip this thread or check some variables. I can only do this when I click Break All. But this will stop all threads. Probably I just missed something?

+4
source share
1 answer

Here is what I did:

  • , , .
  • , , Visual Studio ( , → Windows → ), Ctrl + A ( ), Ctrl + click , . , , .
  • "".

Visual Studio . , , -, , , .

+1

Source: https://habr.com/ru/post/1529267/


All Articles