Export (0) Print
Expand All
Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

System.Threading Namespace

July 28, 2014

The System.Threading namespace provides classes and interfaces that enable multithreaded programming. In addition to classes for synchronizing thread activities and access to data (Monitor, Interlocked, AutoResetEvent, and so on), this namespace includes a ThreadPool class that enables you to use a pool of system-supplied threads, and a Timer class that executes callback methods on thread pool threads. In addition to the features provided in the System.Threading namespace, the BackgroundWorker class provides a simple, event-based way to synchronize access to the main application thread.

  ClassDescription
Public classAbandonedMutexExceptionThe exception that is thrown when one thread acquires a Mutex object that another thread has abandoned by exiting without releasing it.
Public classAutoResetEventNotifies a waiting thread that an event has occurred. This class cannot be inherited.
Public classBarrierEnables multiple tasks to cooperatively work on an algorithm in parallel through multiple phases.
Public classBarrierPostPhaseExceptionThe exception that is thrown when the post-phase action of a Barrier fails
Public classCancellationTokenSourceSignals to a CancellationToken that it should be canceled.
Public classCountdownEventRepresents a synchronization primitive that is signaled when its count reaches zero.
Public classEventWaitHandleRepresents a thread synchronization event.
Public classInterlockedProvides atomic operations for variables that are shared by multiple threads.
Public classLazyInitializerProvides lazy initialization routines.
Public classLockRecursionExceptionThe exception that is thrown when recursive entry into a lock is not compatible with the recursion policy for the lock.
Public classManualResetEventNotifies one or more waiting threads that an event has occurred. This class cannot be inherited.
Public classManualResetEventSlimProvides a slimmed down version of ManualResetEvent.
Public classMonitorProvides a mechanism that synchronizes access to objects.
Public classMutexA synchronization primitive that can also be used for interprocess synchronization.
Public classOverlappedProvides a managed representation of a Win32 OVERLAPPED structure, including methods to transfer information from an Overlapped instance to a NativeOverlapped structure.
Public classReaderWriterLockSlimRepresents a lock that is used to manage access to a resource, allowing multiple threads for reading or exclusive access for writing.
Public classRegisteredWaitHandleRepresents a handle that has been registered when calling RegisterWaitForSingleObject. This class cannot be inherited.
Public classSemaphoreLimits the number of threads that can access a resource or pool of resources concurrently.
Public classSemaphoreFullExceptionThe exception that is thrown when the Semaphore.Release method is called on a semaphore whose count is already at the maximum.
Public classSemaphoreSlimA lightweight alternative to Semaphore that limits the number of threads that can access a resource or pool of resources concurrently.
Public classSynchronizationContextProvides the basic functionality for propagating a synchronization context in various synchronization models.
Public classSynchronizationLockExceptionThe exception that is thrown when a method requires the caller to own the lock on a given Monitor, and the method is invoked by a caller that does not own that lock.
Public classThreadCreates and controls a thread, and gets its status.
Public classThreadAbortExceptionThe exception that is thrown when a call is made to the Abort method. This class cannot be inherited.
Public classThreadLocal<T>Provides thread-local storage of data.
Public classThreadPoolProvides a pool of threads that can be used to post work items, process asynchronous I/O, wait on behalf of other threads, and process timers.
Public classThreadStartExceptionThe exception that is thrown when a failure occurs in a managed thread after the underlying operating system thread has been started, but before the thread is ready to execute user code.
Public classThreadStateExceptionThe exception that is thrown when a Thread is in an invalid ThreadState for the method call.
Public classTimeoutContains a constant that is used to specify an infinite amount of time. This class cannot be inherited.
Public classTimerProvides a mechanism for executing a method at specified intervals. This class cannot be inherited.
Public classVolatileContains methods for performing volatile memory operations.
Public classWaitHandleEncapsulates operating system–specific objects that wait for exclusive access to shared resources.
Public classWaitHandleCannotBeOpenedExceptionThe exception that is thrown when an attempt is made to open a system mutex or semaphore that does not exist.

  StructureDescription
Public structureCancellationTokenPropagates notification that operations should be canceled.
Public structureCancellationTokenRegistrationRepresents a callback delegate that has been registered with a CancellationToken.
Public structureNativeOverlappedProvides an explicit layout that is visible from unmanaged code and that will have the same layout as the Win32 OVERLAPPED structure with additional reserved fields at the end.
Public structureSpinLockProvides a mutual exclusion lock primitive where a thread trying to acquire the lock waits in a loop repeatedly checking until the lock becomes available.
Public structureSpinWaitProvides support for spin-based waiting.

  DelegateDescription
Public delegateIOCompletionCallbackReceives the error code, number of bytes, and overlapped value type when an I/O operation completes on the thread pool.
Public delegateParameterizedThreadStartRepresents the method that executes on a Thread.
Public delegateSendOrPostCallbackRepresents a method to be called when a message is to be dispatched to a synchronization context.
Public delegateThreadStartRepresents the method that executes on a Thread.
Public delegateTimerCallbackRepresents the method that handles calls from a Timer.
Public delegateWaitCallbackRepresents a callback method to be executed by a thread pool thread.
Public delegateWaitOrTimerCallbackRepresents a method to be called when a WaitHandle is signaled or times out.

  EnumerationDescription
Public enumerationEventResetModeIndicates whether an EventWaitHandle is reset automatically or manually after receiving a signal.
Public enumerationLazyThreadSafetyModeSpecifies how a System.Lazy<T> instance synchronizes access among multiple threads.
Public enumerationLockRecursionPolicySpecifies whether a lock can be entered multiple times by the same thread.
Public enumerationThreadStateSpecifies the execution states of a Thread.

Show:
© 2014 Microsoft