Showing results for February 2012 - Page 2 of 2 - .NET Parallel Programming

Feb 6, 2012
0
0

FromAsync(asyncResult, …) vs FromAsync(beginMethod, …)

Stephen Toub - MSFT
Stephen Toub - MSFT

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 overloads: ones that accept an IAsyncResult “asyncResult” as the first pa...

Parallel ExtensionsTask Parallel Library.NET 4
Feb 4, 2012
0
2

Building a custom GetOrAdd method for ConcurrentDictionary

Stephen Toub - MSFT
Stephen Toub - MSFT

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 doesn’t have a value, it adds a value for the key as dictated by either a TValue prov...

Parallel Extensions.NET 4.NET 4.5
Feb 3, 2012
0
0

Know Thine Implicit Allocations

Stephen Toub - MSFT
Stephen Toub - MSFT

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 used in async programming and at a foundational level for many libraries and applications.&nb...

.NET 4.NET 4.5
Feb 2, 2012
2
1

Await, SynchronizationContext, and Console Apps: Part 3

Stephen Toub - MSFT
Stephen Toub - MSFT

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 executing async methods in a console app, or in a unit test framework that doesn’t di...

Parallel Extensions.NET 4.5Async