Showing category results for .NET Parallel Programming

May 24, 2010
Post comments count0
Post likes count1

Why is TaskContinuationsOptions.ExecuteSynchronously opt-in?

Stephen Toub - MSFT

For a relatively advanced feature, I've been surprised how often this question has come up recently. When a task completes, its continuations become available for execution, and by default, a continuation will be scheduled for execution rather than executed immediately.  This means that the continuation has to be queued to the scheduler a...

.NET Parallel Programming
May 16, 2010
Post comments count0
Post likes count0

Blog Platform Upgrades Happening this Week

Stephen Toub - MSFT

Dear Parallel Computing Enthusiasts, This week, Microsoft is rolling out a platform update to all blogs on the http://blogs.msdn.com site, including this one.  Comments on this blog will be disabled at approximately 9pm PST tonight and will be off until mid-day on the 24th.  We also do not expect to publish any new blog posts during this ...

.NET Parallel Programming
May 4, 2010
Post comments count0
Post likes count0

ParallelExtensionsExtras Tour – #16 – Async Tasks for WebClient, SmtpClient, and Ping

Stephen Toub - MSFT

(The full set of ParallelExtensionsExtras Tour posts is available here.) The Task Parallel Library isn’t just about CPU-bound operations.  The Task class is a great representation for any asynchronous operation, even those implemented purely as asynchronous I/O.Task’s ability to represent arbitrary asynchronous operations without...

.NET Parallel Programming
May 4, 2010
Post comments count0
Post likes count0

ParallelExtensionsExtras Tour – #15 – Specialized Task Waiting

Stephen Toub - MSFT

(The full set of ParallelExtensionsExtras Tour posts is available here.)The Task Parallel Library provides the Task.Wait method, which synchronously waits for the target Task to complete.  If the Task completed successfully, the method simply returns.  If the Task completed due to an unhandled exception or cancellation, Wait throws an app...

.NET Parallel Programming
May 3, 2010
Post comments count0
Post likes count0

A TPL Sandbox

Danny Shih

In a previous post, we introduced the UnobservedTaskException event, saying that it would be useful for host-plugin scenarios where a host application should continue to execute in the presence of exceptions thrown by buggy plugins.  A typical example is an Internet browser; should the entire application crash if some rich content plugin crash...

.NET Parallel Programming
Apr 28, 2010
Post comments count0
Post likes count0

ParallelExtensionsExtras Tour – #14 – SingleItemPartitioner

Stephen Toub - MSFT

(The full set of ParallelExtensionsExtras Tour posts is available here.) In a previous ParallelExtensionsExtras Tour blog post, we talked about implementing a custom partitioner for BlockingCollection<T>.  Custom partitioning is an advanced but important feature supported by both Parallel.ForEach and PLINQ, as it allows the develope...

.NET Parallel Programming
Apr 27, 2010
Post comments count0
Post likes count0

ParallelExtensionsExtras Tour – #13 – AsyncCall

Stephen Toub - MSFT

(The full set of ParallelExtensionsExtras Tour posts is available here.)Producer/consumer scenarios could logically be split into two categories: those where the consumers are synchronous, blocking waiting for producers to generate data, and those where the consumers are asynchronous, such that they're alerted to data being available and only then ...

.NET Parallel Programming
Apr 26, 2010
Post comments count0
Post likes count0

Performance of Concurrent Collections in .NET 4

Igor Ostrovsky - MSFT

.NET 4 introduces new data structures designed to simplify thread-safe access to shared data, and to increase the performance and scalability of multi-threaded applications. To best take advantage of these data structures, it helps to understand their performance characteristics in different scenarios.Chunyan Song, Emad Omara and Mike Liddell measu...

.NET Parallel Programming
Apr 23, 2010
Post comments count0
Post likes count0

ParallelExtensionsExtras Tour – #12 – AsyncCache

Stephen Toub - MSFT

(The full set of ParallelExtensionsExtras Tour posts is available here.)Caches are ubiquitous in computing, serving as a staple of both hardware architecture and software development.  In software, caches are often implemented as dictionaries, where some data is retrieved or computed based on a key, and then that key and its resulting data/val...

.NET Parallel Programming
Apr 21, 2010
Post comments count0
Post likes count0

When To Use Parallel.ForEach and When to Use PLINQ

Igor Ostrovsky - MSFT

If you've played around with PLINQ and Parallel.ForEach loops in .NET 4, you may have noticed that many PLINQ queries can be rewritten as parallel loops, and also many parallel loops can be rewritten as PLINQ queries. However, both parallel loops and PLINQ have distinct advantages in different situations. When writing ...

.NET Parallel Programming