Concurrent Programming

A quick review of the Concurrency Visualizer in Visual Studio 2015

The Concurrency visualizer is a free extension available in Visual Studio 2015 that can be used to analyse the performance of a concurrent application. I am going to do a simple overview of this extension.

The tested code

This is the code I am going to profile with the extension. It basically creates four non blocking tasks that compute 1 x 1 infinitely. The main thread then waits for user input.

Concurrency Visualizer in action

CPU Utilization shows that nearly 100% of four cores are used.

cv_cpu_utilization

The profile reports shows that four CLR worker threads (9664, 6352, 5168, and 9724) in execution most of the time, and the main thread waits for I/O most of the time.

cv_threads_view_1

Clicking on a particular worker thread at a particular time shows the call stack.

cv_threads_view_call_stack

The core view show that threads switches cores while running. More specifically, our four worker threads have more than one third of their context switches that cross cores.

cv_core_view

Concurrency visualizer helps identify problems like : serialized execution (thread executing one at a time), poor work distribution, over subscription (too many active threads), overuse of I/O, inefficient synchronization (lock convoys). It seems like a great tool!

Advertisements

One thought on “A quick review of the Concurrency Visualizer in Visual Studio 2015

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