At //BUILD/ in September, we blogged about the wealth of new support available for parallelism in the .NET Framework 4.5 Developer Preview . Since then, we’ve been hard at work on the .NET 4.5 Beta. With the beta just released , here are a few interesting...

In my last past, we looked at building an AsyncLock in terms of an AsyncSemaphore . In this post, we’ll build a more advanced construct, an asynchronous reader/writer lock.
An asynchronous reader/writer lock is more complicated than any of the...

Last time, we looked at building an AsyncSemaphore . Here, we’ll look at building support for an async mutual exclusion mechanism that supports scoping via ‘using’. As mentioned in the previous post, semaphores are great for throttling and resource...

In my last few posts, I covered building an AsyncManualResetEvent , an AsyncAutoResetEvent , an AsyncCountdownEvent , and an AsyncBarrier . In this post, I’ll cover building an AsyncSemaphore class. Semaphores have a wide range of applicability...

Last time, we looked at building an AsyncCountdownEvent . At the end of the post, I highlighted a common pattern for using such a type, which is for all of the participants to signal and then wait for all of the other participants to signal as well...

In my last two posts, I discussed building AsyncManualResetEvent and AsyncAutoResetEvent coordination primitives. In this post, I’ll build on that to create a simple AsyncCountdownEvent. A countdown event is an event that will allow waiters to complete...

In my last post, I discussed building an asynchronous version of a manual-reset event . This time, we’ll build an asynchronous version of an auto-reset event. A manual-reset event is transitioned to the signaled state when requested to do so (i...

The Task-based Async Pattern (TAP) isn’t just about asynchronous operations that you initiate and then asynchronously wait for to complete. More generally, tasks can be used to represent all sorts of happenings, enabling you to await for any matter...

One of the really useful capabilities of the new async methods feature in C# and Visual Basic is the ability to write async lambdas and anonymous methods (from here on in this post, I’ll refer to both of these as async lambdas, since the discussion applies...

When creating a task continuation with ContinueWith, developers have the opportunity to provide a TaskContinuationOptions enum value, which could include the TaskContinuationOptions.ExecuteSynchronously flag. ExecuteSynchronously is a request for...

The Task Parallel Library (TPL) provides a set of “ FromAsync ” helper methods that create a Task or a Task<TResult> to represent an invocation of an APM method pair, i.e. BeginXx / EndXx. There are, however, two different flavors among these...

I was recently asked by a developer about getting some additional information out of ConcurrentDictionary<TKey,TValue>’s GetOrAdd method. As a reminder, GetOrAdd either returns the value for a key currently in the dictionary, or if that key...

For .NET 4.5, we’ve invested quite a bit of effort into performance, and in particular for the Task Parallel Library (Joe Hoag wrote a good paper covering some of these improvements). We focused such effort on TPL because it is a core component...

In Part 1 and Part 2 of this short series, I demonstrated how you can build a SynchronizationContext and use it run an async method such that all of the continuations in that method will run on serialized on the current thread. This can be helpful when...