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: C# memory model articles

    Igor Ostrovsky is one of the minds behind the parallel programming support in the .NET Framework. Igor's recently written a great set of articles for MSDN Magazine to cover " The C# Memory Model in Theory and Practice ". Part 1 is available now in the December 2012 issue , and it's a great read.
  • Blog Post: PLINQ and Int32.MaxValue

    In both .NET 4 and .NET 4.5, PLINQ supports enumerables with up to Int32.MaxValue elements.  Beyond that limit, PLINQ will throw an overflow exception.  LINQ to Objects itself has this limitation with certain query operators (such as the indexed Select operator which counts the elements processed...
  • 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: 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: What’s New for Parallelism in Visual Studio 2012 RC

    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...
  • Blog Post: ConcurrentQueue<T> holding on to a few dequeued elements

    Since .NET 4’s release, I’ve received several questions about a peculiar behavior of ConcurrentQueue<T> having to do with memory management. With Queue<T>, List<T>, and other such data structures in the .NET Framework, when you remove an element from the collection, the collection internally...
  • 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: Do I need to dispose of Tasks?

    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?” Summary Here’s my short answer to this question: “No.  Don’t bother disposing of your tasks.” Here’s my medium-length answer: “No.  Don’t bother disposing...
  • Blog Post: Is it ok to use nested Parallel.For loops?

    Every now and then, I get this question: “is it ok to use nested Parallel.For loops?” The short answer is “yes.”  As is often the case, the longer answer is, well, longer. Typically when folks ask this question, they’re concerned about one of two things.  First, they’re concerned that each...
  • 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...
Page 1 of 9 (212 items) 12345»