Debugging one thread holds up others?
I have a basic question. I am debu开发者_JS百科gging an application and the editor shows 20 threads at one point of time. The control is with one thread which has hit a breakpoint. Will the remaining 19 threads be held up at their respective instructions till the time control is with first one? Or this there a possibility that other threads steal some execution while I debug the first one?
If you are asking about Visual Studio... when it hits the breakpoint, all threads are suspended. But when you are stepping through code, even if you intend to debug a single thread, other threads also get an opportunity to run, this is the default behavior.
You can however freeze individual threads in the Threads window, right-click a thread to see the context menu. Then while you are stepping through the code, "frozen" threads do not get run.
All threads are suspended when the debugger breaks in.
The process is usually suspended, so all thread are suspended.
精彩评论