The class contains support for thread pools, running multiple worker functions concurrently, dealing with threads, and others.
public interface | Interface provided to task runner implementation which can signal cancellation of the operation. |
public static final class | Builder class for executing various tasks with the specified configuration concurrently. |
public interface | Interface for a thread pool that is capable of executing tasks offered to it. |
public interface | Functional interface similar to Consumer, but is capable of throwing an arbitrary exception. |
public interface | Functional interface similar to ThrowingConsumer that can take an another context argument for its
execution. |
public static int | Writes the stack traces of all threads in the JVM to the given print stream. |
public static int | dumpAllThreadStackTraces( Writes the stack traces of all threads in the JVM that the predicate allows. |
public static int | dumpThreadGroupStackTraces( Writes the stack traces of all threads in the JVM which have the given thread group as any of its parent. |
public static int | Not recommended to use, keep track of your desired thread factor, and pass it to the appropriate
configuration parameters instead of using an inheritable thread local configuration. |
public static ThreadGroup | Gets the root (top-level) thread group. |
public static boolean | hasParentThreadGroup( Checks if the given thread has the argument thread group as any of its parent. |
public static void | Interrupts the argument thread if non- null . |
public static void | joinThreads( Joins the argument threads. |
public static void | joinThreads( Joins the argument thread. |
public static void | joinThreads( Joins the argument threads. |
public static void | joinThreadsNonInterruptible( Joins the argument threads non-interruptibly. |
public static void | joinThreadsNonInterruptible( Joins the argument thread non-interruptibly. |
public static void | joinThreadsNonInterruptible( Joins the argument threads non-interruptibly. |
public static ThreadWorkPool | Gets a work pool that executes any task offered to it on the caller thread, at the moment it was offered. |
public static ThreadWorkPool | Creates a new work pool that dynamically creates new threads when new tasks are posted. |
public static ThreadWorkPool | newDynamicWorkPool( Creates a new work pool that dynamically creates new threads when new tasks are posted. |
public static ThreadWorkPool | newDynamicWorkPool( Creates a new work pool that dynamically creates new threads when new tasks are posted. |
public static ThreadWorkPool | newDynamicWorkPool( Creates a new work pool that dynamically creates new threads when new tasks are posted. |
public static ThreadWorkPool | newDynamicWorkPool( Creates a new work pool that dynamically creates new threads when new tasks are posted. |
public static ThreadWorkPool | newDynamicWorkPool( Creates a new work pool that dynamically creates new threads when new tasks are posted. |
public static ThreadWorkPool | newDynamicWorkPool( Creates a new work pool that dynamically creates new threads when new tasks are posted. |
public static Lock | Creates a new non-reentrant Lock that can only be exclusively held by a single thread. |
public static ThreadWorkPool | Creates a new work pool that uses a fixed number of threads for task execution. |
public static ThreadWorkPool | newFixedWorkPool( Creates a new work pool that uses a fixed number of threads for task execution. |
public static ThreadWorkPool | newFixedWorkPool( Creates a new work pool that uses a fixed number of threads for task execution. |
public static ThreadWorkPool | newFixedWorkPool( Creates a new work pool that uses a fixed number of threads for task execution. |
public static ThreadWorkPool | newFixedWorkPool( Creates a new work pool that uses a fixed number of threads for task execution. |
public static ThreadWorkPool | newFixedWorkPool( Creates a new work pool that uses a fixed number of threads for task execution. |
public static ThreadWorkPool | newFixedWorkPool( Creates a new work pool that uses a fixed number of threads for task execution. |
public static ThreadWorkPool | newFixedWorkPool( Creates a new work pool that uses a fixed number of threads for task execution. |
public static ThreadWorkPool | newFixedWorkPool( Creates a new work pool that uses a fixed number of threads for task execution. |
public static ThreadWorkPool | newFixedWorkPool( Creates a new work pool that uses a fixed number of threads for task execution. |
public static ThreadWorkPool | newFixedWorkPool( Creates a new work pool that uses a fixed number of threads for task execution. |
public static ThreadWorkPool | newFixedWorkPool( Creates a new work pool that uses a fixed number of threads for task execution. |
public static ThreadWorkPool | newFixedWorkPool( Creates a new work pool that uses a fixed number of threads for task execution. |
public static ThreadWorkPool | newFixedWorkPool( Creates a new work pool that uses a fixed number of threads for task execution. |
public static ThreadWorkPool | newFixedWorkPool( Creates a new work pool that uses a fixed number of threads for task execution. |
public static ParallelRunner | Creates a new parallel runner builder. |
public static < | runParallelContextItems( Runs the given worker for the specified items and context object supplier the concurrently. |
public static < | runParallelItems( Runs the given worker for the specified items concurrently. |
public static void | runParallelRunnables( Runs the argument runnables concurrently. |
public static void | runParallelRunnables( Runs the argument runnables concurrently. |
public static void | setInheritableDefaultThreadFactor( This method doesn't do anything anymore. Not recommended to use, keep track of your desired thread
factor, and pass it to the appropriate configuration parameters instead of using an inheritable
thread local configuration. |
public static Thread | startDaemonThread( Starts a new daemon thread with the given name that executes the argument runnable. |
public static Thread | startDaemonThread( Starts a new daemon thread with the given name that executes the argument runnable. |
public static Thread | startDaemonThread( Starts a new daemon thread on the given thread group that executes the argument runnable. |
public static Thread | startDaemonThread( Starts a new daemon thread on the given thread group with the specified name that executes the argument runnable. |
public static Thread | startThread( Starts a new thread that executes the argument runnable. |
public static Thread | startThread( Starts a new thread with the given name that executes the argument runnable. |
public static Thread | startThread( Starts a new thread on the given thread group that executes the argument runnable. |
public static Thread | startThread( Starts a new thread on the given thread group with the specified name that executes the argument runnable. |
This method should be used only for informational purposes.
null
.This method should be used only for informational purposes.
null
.This method should be used only for informational purposes.
null
.
This method used to return the value of an inheritable thread local, with an
initial value of Math.max(Runtime.getRuntime().availableProcessors() * 3 / 2, 2)
. Now it returns
this fixed initial value.
The top-level thread group is the one which has no parent.
If any of the arguments are null
, false
is returned.
true
if the thread exists in the hierarchy of the given thread group.null
.If this method finishes successfully, all the arguments thread will be in a finished state.
null
, in which case this function call is a no-op.
This is a single Thread parameter overload of joinThreads(
null
, in which case this function call is a no-op.If this method finishes successfully, all the arguments thread will be in a finished state.
null
, in which case this function call is a no-op.If the current thread is interrupted while joining, the interrupt flag is stored, and the joining will continue. If the thread was interrupted, it will be reinterrupted at the end of the method.
If this method finishes successfully, all the arguments thread will be in a finished state.
null
, in which case this function call is a no-op.If the current thread is interrupted while joining, the interrupt flag is stored, and the joining will continue. If the thread was interrupted, it will be reinterrupted at the end of the method.
This is a single Thread parameter overload of joinThreadsNonInterruptible(
null
, in which case this function call is a no-op.If the current thread is interrupted while joining, the interrupt flag is stored, and the joining will continue. If the thread was interrupted, it will be reinterrupted at the end of the method.
If this method finishes successfully, all the arguments thread will be in a finished state.
null
, in which case this function call is a no-op.The returned work pool will execute offered task immediately when called.
The returned work pool will cache threads for some time, and dynamically allocate new ones if necessary. It will also exit threads if they've not been used for some time.
The returned work pool will cache threads for some time, and dynamically allocate new ones if necessary. It will also exit threads if they've not been used for some time.
"Something-"
. A
thread number identifier will be appended to it by the work pool.The returned work pool will cache threads for some time, and dynamically allocate new ones if necessary. It will also exit threads if they've not been used for some time.
The returned work pool will cache threads for some time, and dynamically allocate new ones if necessary. It will also exit threads if they've not been used for some time.
"Something-"
. A
thread number identifier will be appended to it by the work pool.The returned work pool will cache threads for some time, and dynamically allocate new ones if necessary. It will also exit threads if they've not been used for some time.
"Something-"
. A
thread number identifier will be appended to it by the work pool.null
.The returned work pool will cache threads for some time, and dynamically allocate new ones if necessary. It will also exit threads if they've not been used for some time.
"Something-"
. A
thread number identifier will be appended to it by the work pool.null
.The returned work pool will cache threads for some time, and dynamically allocate new ones if necessary. It will also exit threads if they've not been used for some time.
null
in which case the new
threads are created and their daemon flag and
thread group is set based on the thread that creates the pool.null
.The lock will throw an IllegalThreadStateException in case reentrant locking is attempted.
The threads are lazily started when new tasks are offered to the thread pool.
The threads are lazily started when new tasks are offered to the thread pool.
The threads are lazily started when new tasks are offered to the thread pool.
"Something-"
. A
thread number identifier will be appended to it by the work pool.The threads are lazily started when new tasks are offered to the thread pool.
"Something-"
. A
thread number identifier will be appended to it by the work pool.The threads are lazily started when new tasks are offered to the thread pool.
null
.The threads are lazily started when new tasks are offered to the thread pool.
null
."Something-"
. A
thread number identifier will be appended to it by the work pool.The threads are lazily started when new tasks are offered to the thread pool.
"Something-"
. A
thread number identifier will be appended to it by the work pool.The threads are lazily started when new tasks are offered to the thread pool.
The threads are lazily started when new tasks are offered to the thread pool.
The threads are lazily started when new tasks are offered to the thread pool.
"Something-"
. A
thread number identifier will be appended to it by the work pool.The threads are lazily started when new tasks are offered to the thread pool.
null
.The threads are lazily started when new tasks are offered to the thread pool.
null
."Something-"
. A
thread number identifier will be appended to it by the work pool.The threads are lazily started when new tasks are offered to the thread pool.
null
."Something-"
. A
thread number identifier will be appended to it by the work pool.The threads are lazily started when new tasks are offered to the thread pool.
"Something-"
. A
thread number identifier will be appended to it by the work pool.The threads are lazily started when new tasks are offered to the thread pool.
null
in which case the new
threads are created and their daemon flag and
thread group is set based on the thread that creates the pool.null
.Parallel runners can be used to run specific tasks concurrently, without dealing with thread pools.
See ParallelRunner for more information.
See ParallelRunner for more information.
See ParallelRunner for more information.
See ParallelRunner for more information.
See ParallelRunner for more information.
This method used to set an inheritable thread local variable, whose value would be returned by getDefaultThreadFactor(). This feature is deprecated and that method returns a fixed value based on the available processor count.
null
.null
.null
.null
.null
.null
.null
.null
.