Package org.agrona.concurrent
package org.agrona.concurrent
Concurrent data structures and utilities that support both on and off Java heap usage.
-
ClassDescriptionLeft over immutable queue fields.An Agent is scheduled to do work on a thread on a duty cycle.
Agentcontainer which does not start a thread.Thrown to terminate the work/duty cycle of anAgent.Abstraction over a range of buffer types that allows type to be accessed with various memory ordering semantics.Idling strategy for threads when they have no work to do.Busy spin strategy targeted at lowest possible latency.AnEpochClockthat caches a timestamp which can be updated withCachedEpochClock.update(long).ANanoClockthat caches a timestamp which can be updated withCachedNanoClock.update(long).Group severalAgents into one composite, so they can be scheduled as a unit.IdleStrategywhich can be controlled by a counter so its mode of operation can be switched between doing nothing (NOOP), busy spinning by callingThread.onSpinWait(), yielding by callingThread.yield(), or sleeping for the minimum period by callingLockSupport.parkNanos(long)when work count is zero, so it idles.Callback interface for processing of messages that are read from a buffer.Action to be taken on return fromControlledMessageHandler.onMessage(int, MutableDirectBuffer, int, int).AnErrorHandlerwhich callsAtomicCounter.increment()before delegating the exception.Group severalAgents into one composite, so they can be scheduled as a unit.Enumto indicate the current status of aDynamicCompositeAgent.Retrieves the number of milliseconds since 1 Jan 1970 UTC.Clock representing the time in microseconds since 1 Jan 1970 UTC.Clock representing the time in nanoseconds since 1 Jan 1970 UTC.Clock that provides the number of time units since the 1 Jan 1970 UTC.Control the use of high-resolution timers on Windows by a bit of hackery.Generates unique identifiers that fit in a 64-bit word.Idle strategy for use by threads when they do not have work to do.Many producer to many consumer concurrent queue that is array backed.Many producer to one consumer concurrent queue that is array backed.Concurrent linkedQueuethat can be used from many producers and a single consumer.Callback interface for processing of messages that are read from a buffer.Functional interface for return the current time as system-wide monotonic tick of 1 nanosecond precision.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.ALockimplementation that is a no operation, i.e.An accurate, zero-gc, pure-java,EpochNanoClockthat 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.One producer to one consumer concurrent queue that is array backed.Pipe<E>A container for items exchanged from producers to consumers.QueuedPipe<E>One time witness for blocking one or more threads until: Thread blocked inShutdownSignalBarrier.await()is interrupted. JVM shutdown sequence begins (seeRuntime.addShutdownHook(Thread)).ShutdownSignalBarrier.signal()orShutdownSignalBarrier.signalAll()is invoked programmatically. Useful for shutting down a service.Interface for notification when is signaled.Deprecated, for removal: This API element is subject to removal in a future version.When idle this strategy is to sleep for a specified period in nanoseconds.When idle this strategy is to sleep for a specified period time in milliseconds.Generate unique identifiers based on the Twitter Snowflake algorithm.Implementation that callsSystem.currentTimeMillis().Implementation that callsHighResolutionClock.epochMicros().Implementation that callsHighResolutionClock.epochNanos().ANanoClockthe delegates toSystem.nanoTime().Supports regular, byte ordered, and atomic (memory ordered) access to an underlying buffer.IdleStrategythat will callThread.yield()when the work count is zero.
ShutdownSignalBarrierinstead.