Package org.logicalcobwebs.concurrent
Concurrency utilities.
Originally written by Doug Lea and released into the public domain. This may be used for any purposes whatsoever without acknowledgment. Thanks for the assistance and support of Sun Microsystems Labs, and everyone contributing, testing, and using this code.
-
Interface Summary Interface Description BoundedChannel A channel that is known to have a capacity, signifying thatput
operations may block when the capacity is reached.Callable Interface for runnable actions that bear results and/or throw Exceptions.Channel Main interface for buffers, queues, pipes, conduits, etc.Executor Interface for objects that execute Runnables, as well as various objects that can be wrapped as Runnables.Puttable This interface exists to enable stricter type checking for channels.ReadWriteLock ReadWriteLocks maintain a pair of associated locks.Sync Main interface for locks, gates, and conditions.Takable This interface exists to enable stricter type checking for channels. -
Class Summary Class Description DefaultChannelCapacity A utility class to set the default capacity of BoundedChannel implementations that otherwise require a capacity argumentFJTask Abstract base class for Fork/Join Tasks.FJTask.Par Anew Par
, when executed, runs the tasks provided in the constructor in parallel using coInvoke(tasks).FJTask.Par2 Anew Par(task1, task2)
, when executed, runs task1 and task2 in parallel using coInvoke(task1, task2).FJTask.Seq Anew Seq
, when executed, invokes each task provided in the constructor, in order.FJTask.Seq2 Anew Seq2(task1, task2)
, when executed, invokes task1 and then task2, in order.FJTask.Wrap A FJTask that holds a Runnable r, and calls r.run when executed.FJTaskRunner Specialized Thread subclass for running FJTasks.FJTaskRunner.VolatileTaskRef An object holding a single volatile reference to a FJTask.FJTaskRunnerGroup A stripped down analog of a ThreadGroup used for establishing and managing FJTaskRunner threads.FJTaskRunnerGroup.InvokableFJTask Wrap wait/notify mechanics around a task so that invoke() can wait it outFutureResult A class maintaining a single reference variable serving as the result of an operation.LinkedNode A standard linked list node used in various queue classesLinkedQueue A linked list based channel implementation.ReaderPreferenceReadWriteLock A ReadWriteLock that prefers waiting readers over waiting writers when there is contention.SynchronizedInt A class useful for offloading synch for int instance variables.SynchronizedVariable Base class for simple, small classes maintaining single values that are always accessed and updated under synchronization.WriterPreferenceReadWriteLock A ReadWriteLock that prefers waiting writers over waiting readers when there is contention. -
Exception Summary Exception Description TimeoutException Thrown by synchronization classes that report timeouts via exceptions.