Click or drag to resize

DoubleBufferedQueueManagerT Class

Manages queues to reduce contention for a multithreaded, multiple-producer, single-consumer scenario.
Inheritance Hierarchy
SystemObject
  GSF.CollectionsDoubleBufferedQueueManagerT

Namespace: GSF.Collections
Assembly: GSF.Core (in GSF.Core.dll) Version: 2.4.218-beta+101eee949414e414795e55a6e73d88938f0177b8
Syntax
public class DoubleBufferedQueueManager<T>
View Source

Type Parameters

T
The types of items to be queued.

The DoubleBufferedQueueManagerT type exposes the following members.

Constructors
 NameDescription
Public methodDoubleBufferedQueueManagerT Creates a new instance of the DoubleBufferedQueueManagerT class.
Public methodDoubleBufferedQueueManagerT(Action) Creates a new instance of the DoubleBufferedQueueManagerT class.
Public methodDoubleBufferedQueueManagerT(ActionIListT) Creates a new instance of the DoubleBufferedQueueManagerT class.
Public methodDoubleBufferedQueueManagerT(Action, ActionException) Creates a new instance of the DoubleBufferedQueueManagerT class.
Public methodDoubleBufferedQueueManagerT(ActionIListT, ActionException) Creates a new instance of the DoubleBufferedQueueManagerT class.
Top
Properties
 NameDescription
Public propertyItemsLeft Gets a flag that indicates whether there are any items left to be consumed after the last call to Dequeue.
Top
Methods
 NameDescription
Public methodDequeue Dequeues a list of items produced by the DoubleBufferedQueueProducerTs.
Public methodEqualsDetermines whether the specified object is equal to the current object.
(Inherited from Object)
Protected methodFinalizeAllows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object)
Public methodGetHashCodeServes as the default hash function.
(Inherited from Object)
Public methodGetProducer Creates a producer used to produce items to the consumer of this DoubleBufferedQueueManagerT.
Public methodGetTypeGets the Type of the current instance.
(Inherited from Object)
Protected methodMemberwiseCloneCreates a shallow copy of the current Object.
(Inherited from Object)
Public methodToStringReturns a string that represents the current object.
(Inherited from Object)
Top
Extension Methods
 NameDescription
Public Extension MethodGetEnumValueOrDefault Gets the enumeration constant for value, if defined in the enumeration, or a default value.
(Defined by EnumExtensions)
Public Extension MethodGetEnumValueOrDefaultT Gets the enumeration constant for this value, if defined in the enumeration, or a default value.
(Defined by EnumExtensions)
Top
Remarks
For best results, each thread that is producing items to the consumer should call GetProducer to receive a producer object that will not contend with any other producer. The consumer should either provide a handler to process the queued items or poll the manager by calling Dequeue (not both!). It is not safe to use this class with multiple consumer threads.
See Also