module ForkJoinPool: sig
.. end
Thread pools for fork/join computations.
type
t
The type of thread pools to be used for fork/join computations.
val make : int32 -> bool -> t
make p a
returns a new thread pool with parallelism
p
(target
number of active threads in pool). If
a
is
true
a FIFO scheduling
is used for tasks.
Raises Invalid_argument
if p
is less than 1
.
val await_termination : t -> int64 -> TimeUnit.t -> bool
Waits for pool termination, waiting at most wait for
t
(time value
whose unit is
u
).
Raises Runtime.Interrupted
if the thread is interrupted.
val get_active_thread_count : t -> int32
Returns an estimate of the number of active threads in the pool.
val get_async_mode : t -> bool
Returns the asynchronous mode of the pool.
val get_parallelism : t -> int32
Returns the parallelism of the pool.
val get_pool_size : t -> int32
Returns the number of threads that have started and not terminated in
the pool.
val get_queued_submission_count : t -> int32
Returns an estimate of the number of tasks submitted (but unstarted)
to the pool.
val get_queued_task_count : t -> int64
Returns an estimate of the number of tasks currently queued in the
pool.
val get_running_thread_count : t -> int32
Returns an estimate of the number of threads in the pool.
val get_steal_count : t -> int64
Returns an estimate of the number of tasks stolen from one thread by
another one in the pool.
val has_queued_submissions : t -> bool
Tests whether there are submitted but unstarted tasks in the pool.
val is_quiescent : t -> bool
Tests whether all threads in the pool are idle.
val is_shutdown : t -> bool
Tests whether the pool has been shutdown.
val is_terminated : t -> bool
Tests whether shutdown is completed (including all tasks).
val is_terminating : t -> bool
Tests whether the pool is in the process shutdowning.
val shutdown : t -> unit
Begins a shutdown, executing all submitted tasks, but refusing new
tasks.
val shutdown_now : t -> unit
Begins a shhutdown by cancelling all submitted tasks, and cancelling
running tasks.