Browse by Tags

Tagged Content List
  • Blog Post: Tasks, Monads, and LINQ

    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...
  • Blog Post: "Invoke the method with await"... ugh!

    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...
  • Blog Post: MVP Summit presentation on async

    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...
  • Blog Post: Psychic Debugging of Async Methods

    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...
  • Blog Post: Cooperatively pausing async methods

    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...
  • Blog Post: How do I cancel non-cancelable async operations?

    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...
  • Blog Post: Forking in async methods

    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...
  • Blog Post: TPL Dataflow NuGet Package for .NET 4.5

    As just announced on the Base Class Libraries (BCL) team blog, the RTM release of TPL Dataflow is now available . Enjoy :)
  • Blog Post: Implementing Then with Await

    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...
  • Blog Post: Processing tasks as they complete

    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...
  • Blog Post: ExecutionContext vs SynchronizationContext

    I’ve been asked a few times recently various questions about ExecutionContext and SynchronizationContext, for example what the differences are between them, what it means to “flow” them, and how they relate to the new async/await keywords in C# and Visual Basic.  I thought I’d try to tackle some...
  • Blog Post: Using async/await in WinRT async operations

    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...
  • Blog Post: Performance consideration for Async/Await and MarshalByRefObject

    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...
  • Blog Post: Async Targeting Pack for Visual Studio 11 now available for .NET 4 and Silverlight 5

    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...
  • Blog Post: Using await with WinRT async operations

    Over on the Windows 8 app developer blog, I've written a blog post about using await with WinRT . I hope you enjoy it!
  • Blog Post: Should I expose synchronous wrappers for asynchronous methods?

    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...
  • Blog Post: Async/Await FAQ

    From time to time, I receive questions from developers which highlight either a need for more information about the new “async” and “await” keywords in C# and Visual Basic. I’ve been cataloguing these questions, and I thought I’d take this opportunity to share my answers...
  • Blog Post: Are deadlocks still possible with await?

    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...
  • Blog Post: Overriding Stream Asynchrony

    In .NET 4.5 Beta, the Stream class provides multiple virtual methods related to reading and writing: Read, BeginRead / EndRead, ReadAsync Write, BeginWrite / EndWrite, WriteAsync Flush, FlushAsync CopyToAsync As a developer deriving from Stream, it’s helpful to understand what the base implementations...
  • Blog Post: Should I expose asynchronous wrappers for synchronous methods?

    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...
  • Blog Post: Are you using TPL Dataflow? We’d love to know!

    Are you using the new System.Threading.Tasks.Dataflow.dll library, either from its CTP s or from the .NET 4.5 Developer Preview or Beta?  We'd love to hear about it, and if you have time, what your experiences have been (good or bad).  What kind of solution are you building, and how are you...
  • Blog Post: Implementing a simple ForEachAsync, part 2

    After my previous post , I received several emails and comments from folks asking why I chose to implement ForEachAsync the way I did.  My goal with that post wasn’t to prescribe a particular approach to iteration, but rather to answer a question I’d received… obviously, however, I didn’t provide...
  • Blog Post: Implementing a simple ForEachAsync

    Jon Skeet recently asked me how I might go about implementing the following “asynchronous ForEach” behavior: For each element in an enumerable, run a function that returns a Task<TResult> to represent the completion of processing that element. All of these functions may run asynchronously concurrently...
  • Blog Post: "The Zen of Async" at the MVP Summit 2012

    Thanks to everyone who attended my "The Zen of Async" presentation on Thursday at the MVP Summit. As I've had several requests, here are the slides and code for the talk.
  • Blog Post: What’s New for Parallelism in .NET 4.5 Beta

    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 and related things that are new or have...
Page 1 of 3 (59 items) 123