Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

edu.emory.mathcs.util.concurrent: Javadoc index of package edu.emory.mathcs.util.concurrent.


Package Samples:

edu.emory.mathcs.util.concurrent

Classes:

PooledExecutor: A tunable, extensible thread pool class. The main supported public method is execute(Runnable command) , which can be called instead of directly creating threads to execute commands. Thread pools can be useful for several, usually intertwined reasons: To bound resource use. A limit can be placed on the maximum number of simultaneously executing threads. To manage concurrency levels. A targeted number of threads can be allowed to execute simultaneously. To manage a set of threads performing related tasks. To minimize overhead, by reusing previously constructed Thread objects rather than creating ...
CountDownLatch: A synchronization aid that allows one or more threads to wait until a set of operations being performed in other threads completes. A CountDownLatch is initialized with a given count . The await 55 methods block until the current count 55 reaches zero due to invocations of the countDown() 55 method, after which all waiting threads are released and any subsequent invocations of await 55 return immediately. This is a one-shot phenomenon -- the count cannot be reset. If you need a version that resets the count, consider using a CyclicBarrier . A CountDownLatch is a versatile synchronization tool and ...
BlockingQueue: A java.util.Queue that additionally supports operations that wait for elements to exist when retrieving them, and wait for space to exist when putting them. BlockingQueues do not accept null elements. Implementations throw IllegalArgumentException on attempts to add , put or offer a null . A null is used as a sentinel value to indicate failure of poll operations. BlockingQueues may be capacity bounded. At any given time they may have a remainingCapacity beyond which no additional elements can be put without blocking. BlockingQueues without any intrinsic capacity constraints always report a remaining ...
Executor: An object that executes submitted tasks. This interface provides a way of decoupling task submission from the mechanics of how each task will be run, including details of thread use, scheduling, etc. In the simplest case, an executor can run the submitted task immediately in the caller's thread: class DirectExecutor implements Executor { public void execute(Runnable r) { r.run(); } } However, tasks are typically executed in a different thread than the caller's thread. The executor below spawns a new thread for each task. class ThreadPerTaskExecutor implements Executor { public void execute(Runnable ...
ThreadContext: Represents an immutable snapshot of a thread state. The state consists of delegatable thread locals, context class loader, and a priority. After the snapshot has been taken, it is later possible to execute tasks within that previously stored context using one of perform 55 methods. The thread executing the task need not be the same as the one for which the snapshot was originally taken; i.e. the state can be recovered (for the duration of the task) in any thread invoking "perform". This class is particularly useful in developing thread pools and asynchronous invocation frameworks, where it is common ...
TimeUnit: A TimeUnit represents time durations at a given unit of granularity and provides utility methods to convert across units, and to perform timing and delay operations in these units. TimeUnit is a "featherweight" class. It does not maintain time information, but only helps organize and use time representations that may be maintained separately across various contexts. The TimeUnit class cannot be directly instantiated. Use the SECONDS 55 , MILLISECONDS 55 , MICROSECONDS 55 , and NANOSECONDS 55 static instances that provide predefined units of precision. If you use these frequently, consider ...
PlainThreadFactory: Thread factory implementation that attempts to ensure that created threads are equivalent regardless of threads that request creation. Precisely, created threads belong to the same thread group, and they inherit a "parent thread context" (access control context, DelegatableThreadLocal s, etc.) from the factory creator rather than from the invoker of newThread(java.lang.Runnable) 55 . This thread factory is used as a default for PooledExecutor , as it guarantees deterministic behavior and minimal security properties. Nevertheless, stronger semantics are often neccessary in security-sensitive applications. ...
Future: A Future represents the result of an asynchronous computation. Methods are provided to check if the computation is complete, to wait for its completion, and to retrieve the result of the computation. The result can only be retrieved when the computation has completed. The get method will block until the computation has completed. Once the computation has completed, the result cannot be changed, nor can the computation be restarted or cancelled. Sample Usage class Image { ... }; class ImageRenderer { Image render(byte[] raw); } class App { Executor executor = ... ImageRenderer renderer = ... void ...
SecureAsyncTask: Variant of AsyncTask that overrides method createPerformer 55 so that it always runs with a fixed access control context and thread context inherited from the caller of createPerformer method. This class is intended primarily for subclassing. Typical usage scenario in subclasses is to create a new instance and call createPerformer . As a result, one obtains a runnable that will perform assigned task with the same access permissions, DelegatableThreadLocal s, and the context class loader, regardless of the thread that actually executes the runnable.
QueuedExecutor: An implementation of Executor that queues incoming requests until they can be processed by a single background thread. The thread is not actually started until the first execute request is encountered. Also, if the thread is stopped for any reason (for example, after hitting an unrecoverable exception in an executing task), one is started upon encountering a new request, or if restart() is invoked. Beware that, especially in situations where command objects themselves invoke execute, queuing can sometimes lead to lockups, since commands that might allow other threads to terminate do not run at ...
DynamicArrayBlockingQueue: This class represents queue of objects. Data is generally stored at the bottom of the queue by put and related operations, and read from the top of the queue by take and related operations. The putAtHead family of operations is also provided to allow storing data at the head of the queue. The underlying implementation uses an array, so no memory allocation occur on queue operations apart from situations where array needs to be resized. The initial and maximum capacity of the queue can be specified at the construction time. The maximum capacity may be also set to "infinity", in which case put operations ...
BoundedLinkedQueue: A bounded variant of LinkedQueue class. This class may be preferable to BoundedBuffer because it allows a bit more concurency among puts and takes, because it does not pre-allocate fixed storage for elements, and allows capacity to be dynamically reset. On the other hand, since it allocates a node object on each put, it can be slow on systems with slow allocation and GC. Also, it may be preferable to LinkedQueue when you need to limit the capacity to prevent resource exhaustion. This protection normally does not hurt much performance-wise: When the queue is not empty or full, most puts and takes ...
AsyncTask: A class maintaining a single reference variable serving as the result of an operation. The result cannot be accessed until it has been set. This class is intended primarily for subclassing. Typical usage scenario is to create a new instance and invoke createPerformer 55 , thus obtaining runnable that will execute specified task and set results in that instance. Note that such obtained runnable should be executed only once -- subsequent execution attempts will fail due to "task already completed" condition.
SynchronousQueue: A rendezvous channel, similar to those used in CSP and Ada. Each put must wait for a take, and vice versa. Synchronous channels are well suited for handoff designs, in which an object running in one thread must synch up with an object running in another thread in order to hand it some information, event, or task. If you only need threads to synch up without exchanging information, consider using a Barrier. If you need bidirectional exchanges, consider using a Rendezvous. [ Introduction to this package. ]
DelegatedRunnable: Wrapper for a runnable that ensures that further executions (even if performed by different threads) inherit current access control context and ThreadContext . In particular, the task will always run with the same access permissions, delegatable thread locals , and context class loader, determined at the time of creation of this DelegatedRunnable.
LinkedQueue: A linked list based channel implementation. The algorithm avoids contention between puts and takes when the queue is not empty. Normally a put and a take can proceed simultaneously. (Although it does not allow multiple concurrent puts or takes.) This class tends to perform more efficently than other Channel implementations in producer/consumer applications. [ Introduction to this package. ]
ExecutorService: An executor that provides methods to manage termination. An ExecutorService can be shut down, which will cause it to stop accepting new tasks. After being shut down, the executor will eventually terminate, at which point no tasks are actively executing, no tasks are awaiting execution, and no new tasks can be submitted. The Executors class provides factory methods for the executor services provided in edu.emory.mathcs.util.concurrent .
SecurePooledExecutor: Version of PooledExecutor that ensures propagation of access control context and thread context from call initiator to the thread executing the call. In other words, the executing call will observe access control context, delegatable thread locals, and context class loader, as they existed when the call was scheduled.
Callable: A task that returns a result and may throw an exception. Implementors define a single method with no arguments called call . The Callable interface is similar to java.lang.Runnable , in that both are designed for classes whose instances are potentially executed by another thread. A Runnable , however, does not return a result and cannot throw a checked exception.
ThreadFactory: Interface describing any class that can generate new Thread objects. Using ThreadFactories removes hardwiring of calls to new Thread , enabling applications to use special thread subclasses, default prioritization settings, etc. [ Introduction to this package. ]
TimeoutException: Exception thrown when a blocking operation times out. Blocking operations for which a timeout is specified need a means to indicate that the timeout has occurred. For many such operations it is possible to return a value that indicates timeout; when that is not possible then TimeoutException should be declared and thrown.
ThreadFactoryUser: Base class for Executors and related classes that rely on thread factories. Generally intended to be used as a mixin-style abstract class, but can also be used stand-alone. [ Introduction to this package. ]
DelegatableThreadLocal: Version of a java.lang.InheritableThreadLocal that can be propagated to worker threads by means of ThreadContext .
UncaughtExceptionHandler: Abstraction of the exception handler which receives notifications of exceptions occurred possibly in various parts of the system. Exception handlers present attractive approach to exception handling in multi-threaded systems, as they can handle exceptions that occurred in different threads.

Home | Contact Us | Privacy Policy | Terms of Service