Rate This Content
MSDN
MSDN Library
.NET Development
.NET Framework 3.5

  Switch on low bandwidth view

We were unable to locate this content in hi-in.

Here is the same content in en-us.

This page is specific to
Microsoft Visual Studio 2008/.NET Framework 3.5

Other versions are also available for the following:
.NET Framework Class Library
System.Threading Namespace

The System.Threading namespace provides classes and interfaces that enable multithreaded programming. In addition to classes for synchronizing thread activities and access to data ( Mutex, Monitor, Interlocked, AutoResetEvent, and so on), this namespace includes a ThreadPool class that allows you to use a pool of system-supplied threads, and a Timer class that executes callback methods on thread pool threads.

  ClassDescription
Public classAbandonedMutexException The exception that is thrown when one thread acquires a Mutex object that another thread has abandoned by exiting without releasing it.
Public classAutoResetEvent Notifies a waiting thread that an event has occurred. This class cannot be inherited.
Public classCompressedStack Provides methods for setting and capturing the compressed stack on the current thread. This class cannot be inherited.
Public classEventWaitHandle Represents a thread synchronization event.
Public classExecutionContext Manages the execution context for the current thread. This class cannot be inherited.
Public classHostExecutionContext Encapsulates and propagates the host execution context across threads.
Public classHostExecutionContextManager Provides the functionality that allows a common language runtime host to participate in the flow, or migration, of the execution context.
Public classInterlockedProvides atomic operations for variables that are shared by multiple threads.
Public classLockRecursionException The exception that is thrown when recursive entry into a lock is not compatible with the recursion policy for the lock.
Public classManualResetEvent Notifies one or more waiting threads that an event has occurred. This class cannot be inherited.
Public classMonitor Provides a mechanism that synchronizes access to objects.
Public classMutex A synchronization primitive that can also be used for interprocess synchronization.
Public classOverlapped Provides a managed representation of a Win32 OVERLAPPED structure, including methods to transfer information from an Overlapped instance to a NativeOverlapped structure.
Public classReaderWriterLock Defines a lock that supports single writers and multiple readers.
Public classReaderWriterLockSlim Represents a lock that is used to manage access to a resource, allowing multiple threads for reading or exclusive access for writing.
Public classRegisteredWaitHandle Represents a handle that has been registered when calling RegisterWaitForSingleObject. This class cannot be inherited.
Public classSemaphore Limits the number of threads that can access a resource or pool of resources concurrently.
Public classSemaphoreFullException The exception that is thrown when the Semaphore..::.Release method is called on a semaphore whose count is already at the maximum.
Public classSynchronizationContext Provides the basic functionality for propagating a synchronization context in various synchronization models.
Public classSynchronizationLockException The 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, sets its priority, and gets its status.
Public classThreadAbortException The exception that is thrown when a call is made to the Abort method. This class cannot be inherited.
Public classThreadExceptionEventArgs Provides data for the ThreadException event.
Public classThreadInterruptedException The exception that is thrown when a Thread is interrupted while it is in a waiting state.
Public classThreadPool Provides 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 classThreadStartException The 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 classThreadStateException The exception that is thrown when a Thread is in an invalid ThreadState for the method call.
Public classTimeout Contains a constant used to specify an infinite amount of time. This class cannot be inherited.
Public classTimer Provides a mechanism for executing a method at specified intervals. This class cannot be inherited.
Public classWaitHandleEncapsulates operating system–specific objects that wait for exclusive access to shared resources.
Public classWaitHandleCannotBeOpenedException The exception that is thrown when an attempt is made to open a system mutex or semaphore that does not exist.
  StructureDescription
Public structureAsyncFlowControl Provides the functionality to restore the migration, or flow, of the execution context between threads.
Public structureLockCookie Defines the lock that implements single-writer/multiple-reader semantics. This is a value type.
Public structureNativeOverlapped Provides 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.
  DelegateDescription
Public delegateContextCallback Represents a method to be called within a new context.
Public delegateIOCompletionCallback Receives the error code, number of bytes, and overlapped value type when an I/O operation completes on the thread pool.
Public delegateParameterizedThreadStart Represents the method that executes on a Thread.
Public delegateSendOrPostCallback Represents a method to be called when a message is to be dispatched to a synchronization context.
Public delegateThreadExceptionEventHandler Represents the method that will handle the ThreadException event of an Application.
Public delegateThreadStart Represents the method that executes on a Thread.
Public delegateTimerCallback Represents the method that handles calls from a Timer.
Public delegateWaitCallback Represents a callback method to be executed by a thread pool thread.
Public delegateWaitOrTimerCallback Represents a method to be called when a WaitHandle is signaled or times out.
  EnumerationDescription
Public enumerationApartmentState Specifies the apartment state of a Thread.
Public enumerationEventResetMode Indicates whether an EventWaitHandle is reset automatically or manually after receiving a signal.
Public enumerationLockRecursionPolicy Specifies whether a lock can be entered multiple times by the same thread.
Public enumerationThreadPriority Specifies the scheduling priority of a Thread.
Public enumerationThreadState Specifies the execution states of a Thread.
Tags What's this?: Add a tag
Community Content   What is Community Content?
Add new content RSS  Annotations
Parallel Framework (task parallelism) instead of plain threading      rednael   |   Edit   |   Show History
Instead of using plain threading to develop concurrent software, please also consider task parallelism.

Please read the following articles:
http://blog.rednael.com/2009/02/05/ParallelProgrammingUsingTheParallelFramework.aspx
http://blog.rednael.com/2009/03/16/ParallelFrameworkDownloadAndSupport.aspx

These are articles about basic parallel programming. Examples in C# .Net included. Also, it describes a lightweight parallel framework to work with tasks. Opposed to some other frameworks, this one is very light and very easy to use.
After reading this article, you should be able to write code using parallelism.

Regards,
Martijn

Processing
© 2009 Microsoft Corporation. All rights reserved. Terms of Use  |  Trademarks  |  Privacy Statement
Page view tracker