Introducing Parallel Extensions to the .NET Framework

There is no escaping from concurrency challenges… or is there? (A slightly modified version of this article was published in the August 2008 edition of the MSDN Flash newsletter) Dual, quad, and eight-core processors are becoming the norm. Is your application capable of utilising all available processors? In order to achieve this level of utilisation…

2

Coordination Data Structures – WriteOnce<T>

This is an article in a series of blog entries describing a set of new Coordination Data Structures (CDS) introduced in the June 2008 CTP of the Parallel Extensions for .NET Framework. In C#, when a field declaration includes a readonly modifier, assignments to the fields introduced by the declaration can only occur as part…

1

Coordination Data Structures – SpinLock

This is an article in a series of blog entries describing a set of new Coordination Data Structures (CDS) introduced in the June 2008 CTP of the Parallel Extensions for .NET Framework. Waiting on locks usually result in a thread context switch and associated kernel transition which at times can be considered costly. On a…

5

Coordination Data Structures – LazyInit<T>

This is an article in a series of blog entries describing a set of new Coordination Data Structures (CDS) introduced in the June 2008 CTP of the Parallel Extensions for .NET Framework. LazyInit<T> provides support for several common patterns of lazy initialization. In here we will explore some of those patterns, but first a point…

2

More on self-replicating tasks

Some more stuff to remember when dealing with self-replicating tasks. (See my earlier post for an introduction to Parallel FX and self-replicating tasks): –          Self-replicating tasks should have an inter-replica communication mechanism for communicating the progress/details of the activity. This depends on what the activity is trying to achieve. See here for an example. –         …

1

Digging deeper into PLINQ’s internal implementation

PLINQ is built on top of the Task Parallel Library (TPL) and promises to revolutionise the way we write programs that can benefit from the multi-core processor era. But how does it work internally? This article assumes that you are familiar with the basics of LINQ and have an understanding PLINQ and TPL. In this…

1

How to cancel a task in Parallel FX?

Task Parallel Library (TPL) allows you to easily cancel tasks. Effectively you need to call the Cancel method on the task in question. Imagine the simple sample below: Task task1 = Task.Create(Foo, 10000); static void Foo(object o) {   for (int i = 0; i < (int)o; i++)   {     // some code here…

3

Which memory model?

In his blog, Eric Eilebrecht explains why when writing multithreaded applications today we should stick to the weak ECMA memory model instead of CLR’s much stronger memory model. In principal, I have no issue with using a weaker model than the CLR memory model but my main concern is that “at what cost are we…

2

CLR 2.0 memory model

Memory is usually a shared resource on multithreaded systems therefore access to it must be regulated and fully specified. This specification is often called a “Memory Model”. Optimisations performed by compilers and the emergence of multi-core processors are some of the factors testing the agility of today’s memory models. The simplest such model is the…

2

First look at Parallel FX and self-replicating tasks

The Parallel Computing Platform team at Microsoft has recently launched the Parallel Computing Development Centre along with our first CTP of Parallel FX. In here, I will explore some aspects of the framework. If you feel comfortable with the basics of concurrency then read on. There is obviously PLINQ and the methods defined in the…

2