Click or drag to resize

ThreadedCalculation Methods

The ThreadedCalculation type exposes the following members.

Methods
  NameDescription
Public methodDispose
Releases any resources associated with this instance.
Protected methodDispose(Boolean)
Releases any resources associated with this instance.
Public methodEquals
Determines whether the specified object is equal to the current object.
(Inherited from Object.)
Public methodExecuteInOneThread
Starts the calculation using the calling thread as the one and only worker thread. This method does not return until the calculation is completed.
Protected methodExecuteWorker
Implement this method to perform the calculation. It is called NumberOfThreads times, each call in a separate thread.
Protected methodFinalize
Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object.)
Protected methodFinish
This method is called after all worker threads have finished executing. It Does nothing if not overridden by the derived class.
Public methodStatic memberForTParameter(Int32, Int32, TParameter, ITrackCalculationProgress, ThreadedCalculationBodyCallbackTParameter)
A 'for' loop that is parallelized among multiple threads according to the ThreadingPolicy active in the calling thread. The loop behaves as if written as for (int i = start; i < stop; ++i). Inside the body callback, the ThreadingPolicy will be configured to use only the calling thread for any further parallelizable operations. This usually improves performance by putting the parallelism where it is most useful: in the 'for' loop itself. However, if you do wish to parallelize operations invoked inside the 'for' loop, you must explicitly set the ThreadingPolicy inside the callback.
Public methodStatic memberForTParameter(Int32, Int32, TParameter, ITrackCalculationProgress, ThreadedCalculationBodyCallbackWithProgressTParameter)

A 'for' loop that is parallelized among multiple threads according to the ThreadingPolicy active in the calling thread. The loop behaves as if written as for (int i = start; i < stop; ++i). Inside the body callback, the ThreadingPolicy will be configured to use only the calling thread for any further parallelizable operations. This usually improves performance by putting the parallelism where it is most useful: in the 'for' loop itself. However, if you do wish to parallelize operations invoked inside the 'for' loop, you must explicitly set the ThreadingPolicy inside the callback.

The body of the 'for' loop is given an ITrackCalculationProgress instance that can be used to report detailed information about the progress of individual loop iterations. It is not recommended to use this overload when looping through a large number of iterations or when detailed information about the progress of individual iterations is not required, because there is some overhead to the detailed progress reporting.

Public methodStatic memberForTParameter1, TParameter2(Int32, Int32, TParameter1, TParameter2, ITrackCalculationProgress, ThreadedCalculationBodyCallback2TParameter1, TParameter2)
A 'for' loop that is parallelized among multiple threads according to the ThreadingPolicy active in the calling thread. The loop behaves as if written as for (int i = start; i < stop; ++i). Inside the body callback, the ThreadingPolicy will be configured to use only the calling thread for any further parallelizable operations. This usually improves performance by putting the parallelism where it is most useful: in the 'for' loop itself. However, if you do wish to parallelize operations invoked inside the 'for' loop, you must explicitly set the ThreadingPolicy inside the callback.
Public methodStatic memberForTParameter1, TParameter2(Int32, Int32, TParameter1, TParameter2, ITrackCalculationProgress, ThreadedCalculationBodyCallbackWithProgress2TParameter1, TParameter2)

A 'for' loop that is parallelized among multiple threads according to the ThreadingPolicy active in the calling thread. The loop behaves as if written as for (int i = start; i < stop; ++i). Inside the body callback, the ThreadingPolicy will be configured to use only the calling thread for any further parallelizable operations. This usually improves performance by putting the parallelism where it is most useful: in the 'for' loop itself. However, if you do wish to parallelize operations invoked inside the 'for' loop, you must explicitly set the ThreadingPolicy inside the callback.

The body of the 'for' loop is given an ITrackCalculationProgress instance that can be used to report detailed information about the progress of individual loop iterations. It is not recommended to use this overload when looping through a large number of iterations or when detailed information about the progress of individual iterations is not required, because there is some overhead to the detailed progress reporting.

Public methodGetHashCode
Serves as the default hash function.
(Inherited from Object.)
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Protected methodMemberwiseClone
Creates a shallow copy of the current Object.
(Inherited from Object.)
Public methodStart
Starts the threaded calculation. This method returns immediately after creating the appropriate number of threads. It does not wait for the calculation to be completed.
Public methodToString
Returns a string that represents the current object.
(Inherited from Object.)
Public methodWaitUntilDone
Blocks the calling thread until the calculation has completed. If an exception occurs (or has already occurred) in any of the calculation threads, this method will throw a ThreadException wrapping the exception that was thrown by the calculation thread. The actual exception that occurred can be found in the InnerException property.
Top
See Also