Click or drag to resize

com.espertech.esper.compat.threading.threadlocal Namespace

[Missing <summary> documentation for "N:com.espertech.esper.compat.threading.threadlocal"]

Classes
  ClassDescription
Public classDefaultThreadLocalManager
Public classFastThreadLocalT
IThreadLocal provides the engine with a way to store information that is local to the instance and a the thread. While the CLR provides the ThreadStatic attribute, it can only be applied to static variables; some usage patterns in esper (such as statement-specific thread-specific processing data) require that data be associated by instance and thread. The CLR provides a solution to this known as LocalDataStoreSlot. It has been documented that this method is slower than its ThreadStatic counterpart, but it allows for instance-based allocation.

During recent testing it was determined that the LocalDataStoreSlot was using an amount of time that seemed a bit excessive. We took some snapshots of performance under the profiler. Using that information we retooled the class to provide tight and fast access to thread-local instance-specific data. The class is pretty tightly wound and takes a few liberties in understanding how esper uses it. A ThreadStatic variable is initialized for the IThreadLocal. This item is 'thread-local' and contains an array of 'instance-specific' data. Indexing is done when the IThreadLocal item is created. Under esper this results in roughly one 'index' per statement. Changes to this model resulted in good cost savings in the retrieval and acquisition of local data.

Public classFastThreadLocalFactory
Creates fast thread local objects.
Public classFastThreadStoreT
FastThreadStore is a variation of the FastThreadLocal, but it lacks a factory for object creation. While there are plenty of cases where this makes sense, we actually did this to work around an issue in .NET 3.5 SP1.
Public classSlimThreadLocalT
Public classSlimThreadLocalFactory
Creates slim thread local objects.
Public classSystemThreadLocalT
IThreadLocal implementation that uses the native support in the CLR (i.e. the LocalDataStoreSlot).
Public classSystemThreadLocalFactory
Creates system thread local objects.
Public classXFastThreadLocalT
Public classXFastThreadLocalFactory
Creates slim thread local objects.
Interfaces
  InterfaceDescription
Public interfaceIThreadLocalT
IThreadLocal provides the engine with a way to store information that is local to the instance and a the thread. While the CLR provides the ThreadStatic attribute, it can only be applied to static variables; some usage patterns in esper (such as statement-specific thread-specific processing data) require that data be associated by instance and thread. The CLR provides a solution to this known as LocalDataStoreSlot. It has been documented that this method is slower than its ThreadStatic counterpart, but it allows for instance-based allocation.
Public interfaceIThreadLocalFactory
Creator and manufacturer of thread local objects.
Public interfaceIThreadLocalManager