Showing results for Task Parallel Library - .NET Parallel Programming

Aug 2, 2012
0
11

Processing tasks as they complete

Stephen Toub - MSFT
Stephen Toub - MSFT

Recently I’ve had several folks ask me about how to process the results of tasks as those tasks complete.A developer will have multiple tasks representing asynchronous operations they’ve initiated, and they want to process the results of these tasks, e.g. List<Task<T>> tasks = …; foreach(var t in tasks) { ...

Parallel ExtensionsTask Parallel Library.NET 4.5
Jun 14, 2012
0
0

Using async/await in WinRT async operations

Stephen Toub - MSFT
Stephen Toub - MSFT

Several weeks ago, I wrote a post for the Windows 8 app developer blog that was all about using await and AsTask to consume WinRT async operations.  I've now published a follow-up post that's all about exposing .NET tasks as WinRT async operation.  In a sense, you can think about the first post as showing how to convert from WinRT as...

Parallel ExtensionsTask Parallel Library.NET 4.5
May 31, 2012
0
0

Performance consideration for Async/Await and MarshalByRefObject

Stephen Toub - MSFT
Stephen Toub - MSFT

In the previous "What's New for Parallelism in Visual Studio 2012 RC" blog post, I mentioned briefly that for the .NET 4.5 Release Candidate, StreamReader.ReadLineAsync experienced a significant performance improvement over Beta.  There's an intriguing story behind that, one I thought I'd share here.It has to do with some interesting inte...

Parallel ExtensionsTask Parallel Library.NET 4.5
May 31, 2012
0
0

What’s New for Parallelism in Visual Studio 2012 RC

Stephen Toub - MSFT
Stephen Toub - MSFT

In September, I blogged about what was new for parallelism and asynchrony in the Visual Studio 2012 Developer Preview, and in February I followed that up with a post on what was new in the Beta.  Now that Visual Studio 2012 Release Candidate is out, I want to share a few thoughts on what’s new in the Release Candidate.Most new features f...

Parallel ExtensionsTask Parallel Library.NET 4.5
Apr 26, 2012
0
0

Async Targeting Pack for Visual Studio 11 now available for .NET 4 and Silverlight 5

Stephen Toub - MSFT
Stephen Toub - MSFT

We’re happy to announce that you can now download an Async Targeting Pack for Visual Studio 11 that lets you target .NET 4 and Silverlight 5.  The included DLLs address the previously discussed issue of the Visual Studio 11 Beta compilers being incompatible with the AsyncCtpLibrary* DLLs from the Async CTP; with this targeting pack, you ...

Parallel ExtensionsTask Parallel Library.NET 4
Apr 13, 2012
3
6

Should I expose synchronous wrappers for asynchronous methods?

Stephen Toub - MSFT
Stephen Toub - MSFT

In a previous post Should I expose asynchronous wrappers for synchronous methods?, I discussed “async over sync,” the notion of using synchronous functionality asynchronously and the benefits that doing so may or may not yield. The other direction of “sync over async” is also interesting to explore. Avoid Exposing Synchro...

Parallel ExtensionsTask Parallel Library.NET 4
Apr 12, 2012
0
0

Are deadlocks still possible with await?

Stephen Toub - MSFT
Stephen Toub - MSFT

Developers familiar with parallel programming are also familiar with a wide range of potential problems that can occur when practicing the art.  One of the most well-known issues is “deadlock,” where two or more operations are waiting on each other to complete in a manner such that none of them will be able to complete.I’ve r...

Parallel ExtensionsTask Parallel Library.NET 4.5
Apr 6, 2012
0
0

Overriding Stream Asynchrony

Stephen Toub - MSFT
Stephen Toub - MSFT

In .NET 4.5 Beta, the Stream class provides multiple virtual methods related to reading and writing: As a developer deriving from Stream, it’s helpful to understand what the base implementations do and when you can and should override them.Read, Write, FlushThe Read, Write, and Flush methods are the core synchronous mechanisms...

Parallel ExtensionsTask Parallel Library.NET 4.5
Mar 25, 2012
0
2

Do I need to dispose of Tasks?

Stephen Toub - MSFT
Stephen Toub - MSFT

I get this question a lot: “Task implements IDisposable and exposes a Dispose method.  Does that mean I should dispose of all of my tasks?” SummaryHere’s my short answer to this question: “No.  Don’t bother disposing of your tasks.”Here’s my medium-length answer: “No.  Don&rsquo...

Parallel ExtensionsTask Parallel Library.NET 4
Mar 24, 2012
0
2

Should I expose asynchronous wrappers for synchronous methods?

Stephen Toub - MSFT
Stephen Toub - MSFT

Lately I’ve received several questions along the lines of the following, which I typically summarize as “async over sync”: In my library, I have a method “public T Foo();”.  I’m considering exposing an asynchronous method that would simply wrap the synchronous one, e.g. “public Task<T> FooAsync...

Task Parallel Library.NET 4.NET 4.5