Spring.NET 1.3.0 RC1 for .NET 2.0 API Reference

Spring.Threading Namespace

Missing <summary> Documentation for Spring.Threading

Namespace Hierarchy

Classes

Class Description
CallContextStorage Implements IThreadStorage by using CallContext.
Latch A latch is a boolean condition that is set at most once, ever. Once a single release is issued, all acquires will pass.

Sample usage. Here are a set of classes that use a latch as a start signal for a group of worker threads that are created and started beforehand, and then later enabled.

class Worker implements IRunnable { private readonly Latch startSignal; Worker(Latch l) { startSignal = l; } public void Run() { startSignal.acquire(); DoWork(); } void DoWork() { ... } } class Driver { // ... void Main() { Latch go = new Latch(); for (int i = 0; i < N; ++i) // make threads new Thread(new ThreadStart(new Worker(go)).Start(); DoSomethingElse(); // don't let run yet go.Release(); // let all threads proceed } }
LogicalThreadContext An abstraction to safely store "ThreadStatic" data.
Semaphore

Base class for counting semaphores based on Semaphore implementation from Doug Lea.

SyncHolder Utility class to use an ISync with the C# using () {} idiom
ThreadStaticStorage Implements IThreadStorage by using a ThreadStaticAttribute hashtable.
TimeoutException Thrown by synchronization classes that report timeouts via exceptions. The exception is treated as a form (subclass) of InterruptedException. This both simplifies handling, and conceptually reflects the fact that timed-out operations are artificially interrupted by timers.
TimeoutSync A TimeoutSync is an adaptor class that transforms all calls to acquire to instead invoke attempt with a predetermined timeout value.
Utils Support to account for differences between java nad .NET:

    Interfaces

    Interface Description
    ISync Acquire/Release protocol, base of many concurrency utilities.
    IThreadStorage Specifies the contract a strategy must be implement to store and retrieve data that is specific to the executing thread.