Skip to main content
Microsoft
.NET Parallel Programming
.NET Parallel Programming
  • Home
  • DevBlogs
    • Visual Studio
    • Visual Studio Code
    • Visual Studio for Mac
    • DevOps
    • Developer support
    • CSE Developer
    • Azure SDK
    • IoT
    • Command Line
    • Perf and Diagnostics
    • Dr. International
    • Notification Hubs
    • Math in Office
    • DirectX
    • PIX
    • SurfaceDuo
    • Startups
    • Sustainable Engineering
    • C++
    • Java
    • Java Blog in Chinese
    • JavaScript
    • PowerShell Community
    • PowerShell Team
    • Python
    • Q#
    • TypeScript
    • Visual Basic
    • Visual C#
    • Visual F#
    • .NET
    • ASP.NET
    • NuGet
    • Xamarin
    • #ifdef Windows
    • Apps for Windows
    • Azure Depth Platform
    • Azure Government
    • Bing Dev Center
    • Microsoft Edge Dev
    • Microsoft Azure
    • Office 365 Development
    • Old New Thing
    • Windows MIDI and Music dev
    • Windows Search Platform
    • Azure Cosmos DB
    • Azure Data Studio
    • Azure SQL
    • OData
    • Revolutions R
    • SQL Server Data Tools

    .NET Parallel Programming

    All about Async/Await, System.Threading.Tasks, System.Collections.Concurrent, System.Linq, and more…

    Code Samples Archives | .NET Parallel Programming

    Implementing Then with Await
    Implementing Then with Await
    Avatar Stephen Toub - MSFT August 15, 2012 Aug 15, 2012 08/15/12
    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&...

    Comments are closed.0.NET 4.5Async
    Async Targeting Pack for Visual Studio 11 now available for .NET 4 and Silverlight 5
    Async Targeting Pack for Visual Studio 11 now available for .NET 4 and Silverlight 5
    Avatar Stephen Toub - MSFT April 26, 2012 Apr 26, 2012 04/26/12
    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...

    Comments are closed.0.NET 4.NET 4.5
    Implementing a simple ForEachAsync, part 2
    Implementing a simple ForEachAsync, part 2
    Avatar Stephen Toub - MSFT March 5, 2012 Mar 5, 2012 03/5/12
    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 enough background...

    2.NET 4.5Async
    Implementing a simple ForEachAsync
    Implementing a simple ForEachAsync
    Avatar Stephen Toub - MSFT March 4, 2012 Mar 4, 2012 03/4/12
    Jon Skeet recently asked me how I might go about implementing the following “asynchronous ForEach” behavior: Given what we now know about SemaphoreSlim from my previous post, here’s one way to achieve this: public static Task ForEachAsync<TSource, TResult>(     this IEnumerable<TSource...

    Comments are closed.0.NET 4.5Async
    “The Zen of Async” at the MVP Summit 2012
    “The Zen of Async” at the MVP Summit 2012
    Avatar Stephen Toub - MSFT March 3, 2012 Mar 3, 2012 03/3/12
    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. Toub_MVPSummit2012_ZenOfAsync.zip...

    Comments are closed.0.NET 4.5Async
    Paper :: Guide to Implementing Custom TPL Dataflow Blocks
    Paper :: Guide to Implementing Custom TPL Dataflow Blocks
    Avatar Danny Shih December 5, 2011 Dec 5, 2011 12/5/11
    TPL Dataflow includes a number of built-in, already-implemented blocks that target the most common scenarios.  Additionally, some flexibility is provided by the set of options that may be used to tweak block behaviors.  However, a developer may still choose to implement a custom block for advanced scenarios where the built-in ones ...

    Comments are closed.0.NET 4.5Code Samples
    Coalescing CancellationTokens from Timeouts
    Coalescing CancellationTokens from Timeouts
    Avatar Stephen Toub - MSFT December 3, 2011 Dec 3, 2011 12/3/11
    In the .NET Framework 4.5 Developer Preview, you’ll find that CancellationTokenSource now has timeout support built directly into its implementation.  This makes it very easy to create a token that will automatically have cancellation requested after a particular time interval, e.g. public static CancellationToken FromTimeout(int ...

    Comments are closed.0.NET 4.5Async
    New in .NET 4.5: ThreadLocal.Values
    New in .NET 4.5: ThreadLocal.Values
    Avatar Igor Ostrovsky - MSFT November 10, 2011 Nov 10, 2011 11/10/11
    Available since .NET 4, ThreadLocal<T> is a container that holds a separate value for every thread. In practice, ThreadLocal<T> is often convenient for storing per-thread counters, resources, or partial results. As mentioned earlier on this blog, we have been thinking about adding a Values property to enumerate over the values ...

    Comments are closed.0.NET 4.5Code Samples
    PLINQ Queries That Run in Parallel in .NET 4.5
    PLINQ Queries That Run in Parallel in .NET 4.5
    Avatar Igor Ostrovsky - MSFT November 10, 2011 Nov 10, 2011 11/10/11
    One interesting thing to know about PLINQ is that not all queries are guaranteed to execute in parallel (See PLINQ Queries That Run Sequentially for reference). You can think of the AsParallel method as a hint to run in parallel for query shapes that it believes will be faster. By default, PLINQ prefers to use a simple sequential algorithm ...

    Comments are closed.0.NET 4.NET 4.5
    Crafting a Task.TimeoutAfter Method
    Crafting a Task.TimeoutAfter Method
    Avatar Joe Hoag November 10, 2011 Nov 10, 2011 11/10/11
    Imagine that you have a Task handed to you by a third party, and that you would like to force this Task to complete within a specified time period. However, you cannot alter the “natural” completion path and completion state of the Task, as that may cause problems with other consumers of the Task. So you need a way to obtain a copy or “...

    Comments are closed.0.NET 4.NET 4.5
    • Page 1
    • Page 2
    • Page 3
    • …
    • Page 7
    • Next page
    Relevant Links

    corefx repository on GitHub

    .NET

    Microsoft Azure

    Top Bloggers
    Archive
  • February 2015
  • April 2013
  • March 2013
  • February 2013
  • January 2013
  • December 2012
  • November 2012
  • October 2012
  • September 2012
  • August 2012
  • June 2012
  • May 2012
  • April 2012
  • March 2012
  • February 2012
  • January 2012
  • December 2011
  • November 2011
  • October 2011
  • September 2011
  • June 2011
  • May 2011
  • April 2011
  • February 2011
  • January 2011
  • November 2010
  • October 2010
  • August 2010
  • July 2010
  • June 2010
  • May 2010
  • April 2010
  • March 2010
  • February 2010
  • January 2010
  • December 2009
  • November 2009
  • October 2009
  • September 2009
  • August 2009
  • July 2009
  • June 2009
  • May 2009
  • April 2009
  • March 2009
  • February 2009
  • January 2009
  • December 2008
  • November 2008
  • October 2008
  • September 2008
  • August 2008
  • July 2008
  • June 2008
  • May 2008
  • April 2008
  • March 2008
  • February 2008
  • January 2008
  • December 2007
  • November 2007
  • Stay informed

    Login
    Code Block
    What's new
    • Surface Duo
    • Surface Laptop Go
    • Surface Pro X
    • Surface Go 2
    • Surface Book 3
    • Microsoft 365
    • Windows 10 apps
    • HoloLens 2
    Microsoft Store
    • Account profile
    • Download Center
    • Microsoft Store support
    • Returns
    • Order tracking
    • Virtual workshops and training
    • Microsoft Store Promise
    • Financing
    Education
    • Microsoft in education
    • Office for students
    • Office 365 for schools
    • Deals for students & parents
    • Microsoft Azure in education
    Enterprise
    • Azure
    • AppSource
    • Automotive
    • Government
    • Healthcare
    • Manufacturing
    • Financial services
    • Retail
    Developer
    • Microsoft Visual Studio
    • Windows Dev Center
    • Developer Center
    • Microsoft developer program
    • Channel 9
    • Microsoft 365 Dev Center
    • Microsoft 365 Developer Program
    • Microsoft Garage
    Company
    • Careers
    • About Microsoft
    • Company news
    • Privacy at Microsoft
    • Investors
    • Diversity and inclusion
    • Accessibility
    • Security
    English (United States)
    • Sitemap
    • Contact Microsoft
    • Privacy
    • Manage cookies
    • Terms of use
    • Trademarks
    • Safety & eco
    • About our ads
    • © Microsoft 2021