Showing results for Async - .NET Parallel Programming

Apr 3, 2013
4
1

Tasks, Monads, and LINQ

Stephen Toub - MSFT
Stephen Toub - MSFT

A few years back, Wes Dyer wrote a great post on monads, and more recently, Eric Lippert wrote a terrific blog series exploring monads and C#. In that series, Eric alluded to Task<TResult> several times, so I thought I’d share a few related thoughts on Task<TResult> and the async/await keywords.As both Wes and Eric highlight, a ...

Parallel ExtensionsTask Parallel Library.NET 4.5
Mar 13, 2013
0
2

“Invoke the method with await”… ugh!

Stephen Toub - MSFT
Stephen Toub - MSFT

I can be a bit sensitive when it comes to language and how concepts are conveyed.  I think it’s important to be accurate, even if not precise, when describing what something is or how to use it, as otherwise the folks to whom you’re communicating can easily form the wrong mental model for that thing.  Having a good mental ...

Parallel ExtensionsTask Parallel Library.NET 4.5
Feb 20, 2013
1
0

MVP Summit presentation on async

Stephen Toub - MSFT
Stephen Toub - MSFT

Lucian Wischik and I presented an "async clinic" at the MVP Summit in Bellevue this week.  The async/await keywords in C# and Visual Basic drastically simplify asynchronous programming, but that of course doesn't mean that using them is without any gotchas: the goal of the discussion was to highlight some of the key areas in which&...

Parallel ExtensionsTask Parallel Library.NET 4.5
Jan 28, 2013
0
0

Psychic Debugging of Async Methods

Stephen Toub - MSFT
Stephen Toub - MSFT

These days it’s not uncommon for me to receive an email or read a forum post from someone concerned about a problem they’re experiencing with an async method they’ve written, and they’re seeking help debugging the issue.  Sometimes plenty of information about the bug is conveyed, but other times the communication is ...

Parallel ExtensionsTask Parallel Library.NET 4.5
Jan 13, 2013
0
2

Cooperatively pausing async methods

Stephen Toub - MSFT
Stephen Toub - MSFT

Recently I was writing an app that processed a bunch of files asynchronously.  As with the Windows copy file dialog, I wanted to be able to provide the user with a button that would pause the processing operation.To achieve that, I implemented a simple mechanism that would allow me to pass a “pause token” into the async method, ...

Parallel ExtensionsTask Parallel Library.NET 4.5
Oct 5, 2012
4
1

How do I cancel non-cancelable async operations?

Stephen Toub - MSFT
Stephen Toub - MSFT

This is a question I hear relatively frequently: “I have an async operation that’s not cancelable.  How do I cancel it?” The construction of the question often makes me chuckle, but I understand and appreciate what’s really being asked.  The developer typically isn’t asking how to cancel the operation ...

Parallel ExtensionsTask Parallel Library.NET 4.5
Sep 11, 2012
0
1

Forking in async methods

Stephen Toub - MSFT
Stephen Toub - MSFT

Given that .NET 4.5 has only recently been released in its final form, it’s not surprising that many folks are still very new to the async/await keywords and have misconceptions about what they are and what they do (I’ve tried to clarify some of these in this Async/Await FAQ).  One of the more common misconceptions is that a method...

Parallel ExtensionsTask Parallel Library.NET 4.5
Aug 21, 2012
0
0

TPL Dataflow NuGet Package for .NET 4.5

Stephen Toub - MSFT
Stephen Toub - MSFT

As just announced on the Base Class Libraries (BCL) team blog, the RTM release of TPL Dataflow is now available.Enjoy...

Parallel Extensions.NET 4.5Async
Aug 15, 2012
0
0

Implementing Then with Await

Stephen Toub - MSFT
Stephen Toub - MSFT

In a post a while ago, I talked about sequential composition of asynchronous operations.  Now that we have the async/await keywords in C# and Visual Basic, such composition is trivial, and async/await are indeed the recommended way to achieve such composition with these languages.However, in that post I also described a few “Then” ...

Parallel ExtensionsTask Parallel Library.NET 4.5
Aug 2, 2012
0
9

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