Debugging multithreaded or recursive operations

Hi all.  I hope everyone is making their day great. I had a scenario where the Watch value of an expression was valuable to see during the recursion of a function. I had a recursive SolveSolution function and it worked with continuously getting the next empty cell and plugging in a trial value in that to see if it was a legal move.

The Parallel Watch window is a great tool in this manner. You can add several watches and they each go in as a column value.  Here’s a screenshot to follow along into the recursive method. Take note of the Recursion Depth value as well.Parallel Watch window

Using the output of this tool, the application bug that I’d remaining was a lot easier to resolve and resulted in a quicker resolution. Hope this helps!

References

MSDN – How to: Use the Parallel Watch Window
MSDN – Walkthrough: Debugging a Parallel Application
http://www.dotnetcurry.com/visualstudio/994/debugging-parallel-code-visual-studio

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s