Package org.agrona.concurrent
Concurrent data structures and utilities that support both on and off Java heap usage.
-
Interface Summary Interface Description Agent An Agent is scheduled to do work on a thread on a duty cycle.AtomicBuffer Abstraction over a range of buffer types that allows type to be accessed with memory ordering semantics.ControlledMessageHandler Callback interface for processing of messages that are read from a buffer.EpochClock Retrieves the number of milliseconds since 1 Jan 1970 UTC.EpochMicroClock Clock representing the time in microseconds since 1 Jan 1970 UTC.EpochNanoClock Clock representing the time in nanoseconds since 1 Jan 1970 UTC.IdGenerator Generates unique identifiers that fit in a 64-bit word.IdleStrategy Idle strategy for use by threads when they do not have work to do.MessageHandler Callback interface for processing of messages that are read from a buffer.NanoClock Functional interface for return the current time as system-wide monotonic tick of 1 nanosecond precision.Pipe<E> A container for items exchanged from producers to consumers.QueuedPipe<E> Composed interface for concurrentQueue
andPipe
. -
Class Summary Class Description AbstractConcurrentArrayQueue<E> Left over immutable queue fields.AbstractConcurrentArrayQueueConsumer Values for the consumer that are expected to be padded.AbstractConcurrentArrayQueuePadding1 Pad out a cacheline to the left of a producer fields to prevent false sharing.AbstractConcurrentArrayQueuePadding2 Pad out a cacheline between the producer and consumer fields to prevent false sharing.AbstractConcurrentArrayQueuePadding3 Pad out a cacheline between the producer and consumer fields to prevent false sharing.AbstractConcurrentArrayQueueProducer Value for the producer that are expected to be padded.AbstractSnowflakeIdGeneratorPaddingLhs AbstractSnowflakeIdGeneratorPaddingRhs AbstractSnowflakeIdGeneratorValue AgentInvoker Agent
container which does not start a thread.AgentRunner Agent runner containing anAgent
which is run on aThread
.BackoffIdleStrategy Idling strategy for threads when they have no work to do.BackoffIdleStrategyData BackoffIdleStrategyPrePad BusySpinIdleStrategy Busy spin strategy targeted at lowest possible latency.CachedEpochClock AnEpochClock
that caches a timestamp which can be updated withCachedEpochClock.update(long)
.CachedEpochClockPadding Pad out a cacheline to the left of a value to prevent false sharing.CachedEpochClockValue Value for the sequence that is expected to be padded.CachedNanoClock ANanoClock
that caches a timestamp which can be updated withCachedNanoClock.update(long)
.CachedNanoClockPadding Pad out a cacheline to the left of a value to prevent false sharing.CachedNanoClockValue Value for the sequence that is expected to be padded.CompositeAgent Group severalAgent
s into one composite, so they can be scheduled as a unit.ControllableIdleStrategy IdleStrategy
which can be controlled by a counter so its mode of operation can be switched between doing nothing (NOOP), busy spinning by callingThreadHints.onSpinWait()
, yielding by callingThread.yield()
, or sleeping for the minimum period by callingLockSupport.parkNanos(long)
when work count is zero, so it idles.CountedErrorHandler AnErrorHandler
which callsAtomicCounter.increment()
before delegating the exception.DynamicCompositeAgent Group severalAgent
s into one composite, so they can be scheduled as a unit.HighResolutionClock Clock that provides the number of time units since the 1 Jan 1970 UTC.HighResolutionTimer Control the use of high-resolution timers on Windows by a bit of hackery.ManyToManyConcurrentArrayQueue<E> Many producer to many consumer concurrent queue that is array backed.ManyToOneConcurrentArrayQueue<E> Many producer to one consumer concurrent queue that is array backed.ManyToOneConcurrentLinkedQueue<E> Concurrent linkedQueue
that can be used from many producers and a single consumer.ManyToOneConcurrentLinkedQueueHead<E> Value for the head that is expected to be padded.ManyToOneConcurrentLinkedQueuePadding1 Pad out a cache line to the left of a tail to prevent false sharing.ManyToOneConcurrentLinkedQueuePadding1.Node<E> ManyToOneConcurrentLinkedQueuePadding2<E> Pad out a cache line between the tail and the head to prevent false sharing.ManyToOneConcurrentLinkedQueueTail<E> Value for the tail that is expected to be padded.MemoryAccess Memory access operations which encapsulate the use of Unsafe.NoOpIdleStrategy Low-latency idle strategy to be employed in loops that do significant work on each iteration such that any work in the idle strategy would be wasteful.NoOpLock ALock
implementation that is a no operation, i.e.OffsetEpochNanoClock An accurate, zero-gc, pure-java,EpochNanoClock
that calculates an initial epoch nano time based onSystem.currentTimeMillis()
and then uses that offset to adjust the return value ofSystem.nanoTime()
to the UNIX epoch.OffsetEpochNanoClock.TimeFields OneToOneConcurrentArrayQueue<E> One producer to one consumer concurrent queue that is array backed.ShutdownSignalBarrier One time barrier for blocking one or more threads until a SIGINT or SIGTERM signal is received from the operating system or by programmatically callingShutdownSignalBarrier.signal()
.SigInt Utility to allow the registration of a SIGINT handler that hides the unsupportedSignal
class.SigIntBarrier One time barrier for blocking one or more threads until a SIGINT signal is received from the operating system or by programmatically callingSigIntBarrier.signal()
.SleepingIdleStrategy When idle this strategy is to sleep for a specified period in nanoseconds.SleepingMillisIdleStrategy When idle this strategy is to sleep for a specified period time in milliseconds.SnowflakeIdGenerator Generate unique identifiers based on the Twitter Snowflake algorithm.SystemEpochClock Implementation that callsSystem.currentTimeMillis()
.SystemEpochMicroClock Implementation that callsHighResolutionClock.epochMicros()
.SystemEpochNanoClock Implementation that callsHighResolutionClock.epochNanos()
.SystemNanoClock ANanoClock
the delegates toSystem.nanoTime()
.UnsafeBuffer Supports regular, byte ordered, and atomic (memory ordered) access to an underlying buffer.YieldingIdleStrategy IdleStrategy
that will callThread.yield()
when the work count is zero. -
Enum Summary Enum Description ControlledMessageHandler.Action Action to be taken on return fromControlledMessageHandler.onMessage(int, MutableDirectBuffer, int, int)
.DynamicCompositeAgent.Status Enum
to indicate the current status of aDynamicCompositeAgent
. -
Exception Summary Exception Description AgentTerminationException Thrown to terminate the work/duty cycle of anAgent
.