Dec 02 2007

Parallel Computing with .NET

Category: .microsoftAmit Bahree @ 6:00 pm

With all the modern systems using multi-core and multi-processor systems, tapping this new power is an interesting challenge for developers. It also fundamentally starts the shift on how your "average Joe" interacts with a computer and things that he/she expects to be able to. First, check out the "Manycore Shift" paper from Microsoft. Second checkout the Parallel Extensions to .NET 3.5 which is a programing model for data and task parallelism. It also helps with coordination on parallel hardware (such as multi-core CPU's) via a common work schedules. There is also a new Parallel Computing Dev Center on MSDN. Before you download the December 2007 CTP, make sure you have the RTM bits of the .NET 3.5 runtime. There are also a number of bugs fixed in this new CTP. If you want a quick introduction then check out a few videos available.

The runtime for this is responsible for mapping parallelism expressed in an application to the actual capabilities of the underlying hardware of multi-core or multi-processor machines. The runtime determines at runtime the number of threads to create. It also monitors this to tweak this and see if any more or fewer threads are needed. The runtime also scales up as more cores become available without any change to your application.

Microsoft also says "Because Parallel Extensions exploits multiple processors, we recommended that you install this directly onto an OS. Using virtualization technologies is not recommended due to restrictions on the maximum number of processors supported by today’s common virtualization technologies." [sic]

There are several approaches you can use to expresses parallelism. Here is a brief from the documentation on these:

  1. Declarative Data – Parallel Language Integrated Query (or Parallel LINQ) is an implementation of LINQ-to-Objects that executes queries in parallel, scaling to utilize the available cores and processors of the machine. Because queries are declarative, you are able to express what you want to accomplish, rather than how you want to accomplish it.
  2. Imperative Data – Parallel Extensions also contains mechanisms to express common imperative data-oriented operations such as for and foreach loops, automatically dividing the work in the loop to run on parallel hardware.
  3. Imperative Task – Rather than using data to drive parallelism, Parallel Extensions enables you to express potential parallelism via expressions and statements that take the form of lightweight tasks. Parallel Extensions schedules these tasks to run on parallel hardware and provides capabilities to cancel and wait on tasks.

Now, I just need to take out the time to play with this; does anyone know how I can rar up some hours in a day and squeeze in a bit more?

Other similar posts to check out:
  • February 14, 2010 -- Bing Maps adding Flickr images, live video, stars (0)
    Bing Maps adding Flickr images, live video and stars - very cool. Update: The official TED video below is quite cool and in addition to the one above, also adds more interesting features such as video – check it out. ...
  • December 11, 2009 -- Extending WCF Adapters in BizTalk (0)
    I know a little bit about WCF :) but never really used it in anger in BizTalk and also did not get an opportunity to extend the adapter. I was looking for something else and came across this post form Paolo which explains in a lot of detail how does one go about extending and customizing WCF adapters. If you don’t know anything about WCF the first part explains that in general before going in to the BizTalk specific things....
  • December 6, 2009 -- BizTalk Flat File schema optional attribute issue (0)
    I encountered this interesting issue and thanks to Colin we were able to resolve it. There will be situations you will encounter when adding additional optional attributes to a Flat File (FF) schema in BizTalk will cause problems. To get around this you basically will need to set the following properties to relax the parsing of the attributes which break. parser_optimization="complexity" allow_early_termination="true" early_terminate_optional_fields="true&qu...
  • January 16, 2009 -- Enabling Bitlocker Pin on Win 7 (0)
    You should be using Bitlocker on your machine (which btw is faster on Win 7 compared to Vista). When I enabled this on my laptop running Win 7 – I did not get the option to also add a PIN – not sure if I did something wrong or by default it does not ask for it. In any case, if you also want to add the a PIN on boot up then you can use the following command in a command prompt or power shell (with admin privileges) to enable this. Of course replace the “c:” with the drive you want to do this fo...
  • November 11, 2008 -- PDC Sessions (0)
    Irrespective if you attended PDC or not and want to get your hands on the ppt’s and/or video of each of the sessions then Mike has a cool post listing each of the sessions including the friendly name instead of the non-helpful code....

Tags:

Leave a Reply

Get Adobe Flash playerPlugin by wpburn.com wordpress themes