Parallellism

Creating Higher Level APIs with TPL

The BCL has a bunch of APIs which provide asynchronous versions of operations in the form of either Beginxxx/Endxxx or XyzCompleted, the former known as Asynchronous Programming Model(APM) and the latter known as Event Based Asynchronous Pattern (EAP). TPL provides a nice abstraction for performing asynchronous operations as Tasks using delegates, but what can you do for working with these existing BCL classes which already have an async version? Here is an example. Let's say we need to download...
  • Share This Post:
  • Share on Twitter
  • Share on Facebook
  • Share on Technorati

Inside TPL video

No code today. Instead, here is a link to a great video from Channel9 I found, which takes a deep dive into the underlying mechanics of how TPL does what it does and some of the enhancements that the thread pool has undergone. Albeit a year old, this video goes into details of the work stealing algorithm and local thread queues that helps increase throughput. From the perspective of being a consumer of TPL, you can be blissfully ignorant of what happens behind the scenes, but understanding the mechanics...
  • Share This Post:
  • Share on Twitter
  • Share on Facebook
  • Share on Technorati

Performing multiple Asynchronous Actions using TPL

I finally had a chance to install VS2010 Beta 1.Full instruction on how to here VS2010 has undergone a major overhaul since VS 2008, a peek are some of the cool new eye candy can be found here I've been waiting to get my hands on the TPL/PLINQ stuff and the Beta was definitely worth the wait. In a previous post we talked about using asynchronous actions for performing long running operations. I was anxious to see how the new TPL stuff would help in achieving the same thing. Interestingly enough,...
  • Share This Post:
  • Share on Twitter
  • Share on Facebook
  • Share on Technorati

Performing multiple Asynchronous Actions for long running operations

The Action delegate in .NET is pretty handy when you need to invoke a method that takes no arguments. You assign the method name or an anonymous delegate/lambda to an Action delegate variable and just call the delegate variable to have your method invoked. But, what if you needed to invoke multiple actions simultaneously or wait for all actions to complete before the main thread can proceed? Maybe these actions are responsible for pre-fetching data from a service that the main thread requires or...
  • Share This Post:
  • Share on Twitter
  • Share on Facebook
  • Share on Technorati