Showing results for January 2012 - .NET Parallel Programming

Jan 23, 2012
2
0

Advanced APM Consumption in Async Methods

Stephen Toub - MSFT
Stephen Toub - MSFT

I’ve previously blogged about how to expose existing Asynchronous Programming Model (APM) implementations as Task-based methods.  This can be done manually using a TaskCompletionSource<TResult>, or it can be done using the built-in wrapper provided in TPL via the Task.Factory.FromAsync method.  By creating a Task-based wrapper...

Parallel Extensions.NET 4.5Async
Jan 21, 2012
0
0

Await, SynchronizationContext, and Console Apps: Part 2

Stephen Toub - MSFT
Stephen Toub - MSFT

Yesterday, I blogged about how you can implement a custom SynchronizationContext in order to pump the continuations used by async methods so that they may be processed on a single, dedicated thread.  I also highlighted that this is basically what UI frameworks like Windows Forms and Windows Presentation Foundation do with their message pumps.N...

Parallel ExtensionsTask Parallel Library.NET 4
Jan 20, 2012
0
0

Implementing a SynchronizationContext.SendAsync method

Stephen Toub - MSFT
Stephen Toub - MSFT

I recently saw two unrelated questions, the answers to which combine to form a potentially useful code snippet.The first question was about SynchronizationContext.  SynchronizationContext provides a Post method, which asynchronously schedules the supplied delegate and object state to be executed according to the SynchronizationContext’s ...

Parallel ExtensionsTask Parallel Library.NET 4
Jan 20, 2012
4
3

Await, SynchronizationContext, and Console Apps

Stephen Toub - MSFT
Stephen Toub - MSFT

When I discuss the new async language features of C# and Visual Basic, one of the attributes I ascribe to the await keyword is that it “tries to bring you back to where you were.” For example, if you use await on the UI thread of your WPF application, the code that comes after the await completes should run back on that same UI thread. ...

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

FAQ on Task.Start

Stephen Toub - MSFT
Stephen Toub - MSFT

Recently I’ve heard a number of folks asking about Task.Start, when and when not to use it, how it behaves,and so forth.  I thought I’d answer some of those questions here in an attempt to clarify and put to rest any misconceptions about what it is and what it does.1. Question: When can I use Task.Start?The Start instance method ma...

Parallel ExtensionsTask Parallel Library.NET 4