With parallel processing be it background or task in debug will jump around. I end up adding a break point at every line. Is there a way to only step in the task and just put a single break point at the beginning?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
While paused in the debugger, you can use the Threads window to have more control over context switching. You can right click on a Thread and select Freeze. This will prevent the debugger from switching to that thread while you’re stepping through code. You can also Shift-Select multiple threads and Freeze them all. If you Freeze all threads other than the thread you’re stepping though, you can step through unhindered by other processing.
It’s a bit awkward, but you can also use this to investigate some types of race conditions by explicitly Thawing only one thread and then forcing the active thread to change (using Switch to Thread) at the specific point you want to test. This won’t replicate all types of threading synchronization issues (some are much more subtle, dealing with memory caching on separate CPUs and the like), but you can see the effects of alternate execution orders (such as some deadlock scenarios.)