Parallel Extension in .NET 4.0 (Part 5 – Visualization Support from IDE)

What we have cover so far?

So far in the Parallel Extension series, I’ve talked about:

  1. Introduction and Motivation of Parallel Extension
  2. The Task Parallel Library in Parallel Extension
  3. PLINQ (Parallel version of LINQ)
  4. Debugging Feature of IDE

Visualization Support – Parallel Stacks Window

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.

image

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.

image

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.

image

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.

image

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.

image

Hopefully this post is useful for you.

Share this post: | | | |
Published Sunday, May 02, 2010 7:36 PM by Wely

Comments

No Comments
Powered by Community Server (Commercial Edition), by Telligent Systems