Wednesday, July 2, 2008

[2008.07.01] Parallel Extensions: Coordinate Data Structures Overview

  • the June 2008 CTP introduces a set of coordination data structures (CDS) that complement PLINQ and the Task Parallel Library
  • the System.Threading namespace of the .NET Framework 3.5 already contains a handful of synchronization primitives, such as Events, Monitor, ManualResetEvent, Mutex and Semaphore.
  • these types are still very useful for developing multithreading applications, and in fact Parallel Extensions relies on many of them, but sometimes higher-level or lighter-weight primitives are required to facilitate communications between threads
  • many parallel applications, however, would benefit greatly from higher-level or lighter-weight constructs are required to facilitate communications between threads such as thread-safe collections, more sophisticated locking primitives, data structures to facilitate work exchange, and types that control how variables are initialized
  • Parallel Extensions adds several such constructs to the namespaces of System.Threading and System.Threading.Collections
  • these new structures are as follows:
CDS in System.Threading
System.Threading.SpinWait

System.Threading.SpinLock

System.Threading.ManualResetEventSlim

System.Threading.SemaphoreSlim

System.Threading.CountdownEventm

System.Threading.LazyInit

System.Threading.WriteOnce
CDS in System.Threading.Collections
System.Threading.BlockingCollection

System.Threading.ConcurrentQueue

System.Threading.ConcurrentStack

No comments: