Showing results for Coordination Data Structures - .NET Parallel Programming

Nov 10, 2011
0
0

New in .NET 4.5: ThreadLocal.Values

Igor Ostrovsky - MSFT
Igor Ostrovsky - MSFT

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 from all...

Parallel Extensions.NET 4.5Code Samples
Nov 8, 2011
0
0

ConcurrentDictionary Performance Improvements in .NET 4.5

Igor Ostrovsky - MSFT
Igor Ostrovsky - MSFT

ConcurrentDictionary is a popular concurrent data structure that was introduced in .NET 4. In the .NET 4.5 release, ConcurrentDictionary gets two performance improvements. One optimization is related to the way ConcurrentDictionary avoids torn reads and writes. To explain the background, all reference types and some value types are guaranteed to b...

Parallel Extensions.NET 4.5Code Samples
Sep 17, 2011
0
0

What’s New For Parallelism in .NET 4.5

Stephen Toub - MSFT
Stephen Toub - MSFT

.NET 4 and Visual Studio 2010 saw the introduction of a wide range of new support for parallelism: the Task Parallel Library (TPL), Parallel LINQ (PLINQ), new synchronization and coordination primitives and collections (e.g. ConcurrentDictionary), an improved ThreadPool for handling parallel workloads, new debugger windows, new concurrency visualiz...

Parallel ExtensionsTask Parallel Library.NET 4.5
Jun 6, 2011
0
0

Parallel Merge Sort using Barrier

Emad Omara
Emad Omara

Sorting is one of the most fundamental problems in software algorithms; there are many sequential sorting algorithms with different time and memory complexities, but when it comes to parallel sort, things get more complicated. I will explain a simple and scalable algorithm to write a parallel sort using the .NET 4.0 System.Threading.Barrier synchro...

Parallel ExtensionsTask Parallel Library.NET 4
Apr 2, 2011
0
2

Little-known gems: Atomic conditional removals from ConcurrentDictionary

Stephen Toub - MSFT
Stephen Toub - MSFT

ConcurrentDictionary<TKey,TValue>, first introduced in .NET 4, is an efficient dictionary data structure that enables thread-safe reading and writing, meaning that multiple threads may all be accessing the dictionary at the same time without corrupting it.  It supports adding through its TryAdd method, conditional updates through its Try...

.NET 4Coordination Data Structures
Feb 15, 2011
0
0

SpinWait.SpinUntil for unit testing

Stephen Toub - MSFT
Stephen Toub - MSFT

One of the hidden gems in .NET 4 is the System.Threading.SpinWait type.  This type is typically used for implementing lock-free solutions, and is used heavily throughout the rest of the threading and parallelism support in .NET 4.  That’s why I call it “hidden”, because most folks don’t implement their own lock-fre...

Parallel Extensions.NET 4Coordination Data Structures
Oct 21, 2010
0
0

New Feature? :: ThreadLocal.Values

Danny Shih
Danny Shih

We’ve been considering adding a Values property to System.Threading.ThreadLocal<T>.  Values would return a collection of all current values from all threads (e.g. what you’d get if you evaluated Value from each thread).  This would allow for easy aggregations, and in fact in our Parallel Extensions Extras we have a wrapp...

Parallel ExtensionsTask Parallel LibraryCoordination Data Structures
Jul 2, 2010
0
0

Using Cancellation Support in .NET Framework 4

Igor Ostrovsky - MSFT
Igor Ostrovsky - MSFT

The .NET Framework 4 introduces a new mechanism for cancellation of operations, based on new types CancellationToken and CancellationTokenSource. This cancellation mechanism is used across the parallel programming libraries: tasks, concurrent collections, and PLINQ queries.Using Cancellation Support in .NET Framework 4, written by Mike Li...

Parallel Extensions.NET 4Coordination Data Structures
May 25, 2010
0
0

Lesser-known Multi-threaded Debugging Support in Visual Studio 2010

Stephen Toub - MSFT
Stephen Toub - MSFT

We’ve been very excited about the new debugging windows in Visual Studio 2010, namely Parallel Tasks and Parallel Stacks, as well as the newly revamped Threads window, and thus we’ve talked about them quite a bit. For an overview, you can read the MSDN Magazine article at https://msdn.microsoft.com/en-us/magazine/ee410778.aspx, and Daniel Moth has ...

Parallel ExtensionsTask Parallel LibraryPLINQ
Apr 28, 2010
0
0

ParallelExtensionsExtras Tour – #14 – SingleItemPartitioner

Stephen Toub - MSFT
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...

Parallel ExtensionsTask Parallel Library.NET 4