So far in the Parallel Extension series, I’ve talked about:
Having seen debugging support on the previous post, now I’ll show you more sophisticated feature, the visualization support, namely Parallel Stack Window.
I’ll continue to use the previous sample code as demonstration.
Step 1 – Put a break point at the Parallel.For section as following.
Step 2 – Run the application by simply click F5.
As expected, the program will stop at the breakpoint.
Step 3 – On the menu, click Debug – Windows – Parallel Stacks.
The parallel stack windows will shown up immediately as following.
Step 4 – Remembering that we could freely dock the windows in VS2010, you may want to dock it to the right side of the IDE to make it looks more comfortable.
Step 5 – Continue to click on Step Into or F11 to debug the program step by step for a few time. You will see the visualization as following.
Here, you can clearly see that there are three threads are running, and all of them are children of main thread with id 5.
Step 6 – Just continue clicking F10 for a few times, you could see that some of the threads are gone when they have done their jobs.
Hopefully this post is useful for you.