module Shared: sig
.. end
Advanced implementation with functorial interface
This module provides advanced task management.
Pools dispatch computations among registered agents, re-issuing pending
tasks if agents do not send computation outcomes.
It improves over the more simple JoinPool.Simple
in the following aspects:
- The same pool can be shared by several computations.
- More efficient handling of task re-issuing: fresh tasks have priority
over re-issued tasks.
- Ability to abort duplicated tasks when outcome reaches the pool.
- A little control on pool behavior is offered by the means
of the
JoinPool.Shared.Config
module
argument.
Arguments
module type Config = sig
.. end
Configuration of pool
module type Enumerable = sig
.. end
Functional enumerations
Pools
type ('elt, 'partial)
worker = 'elt -> 'partial
Standard workers
type
subtask_id = int
Subtask identifier
type ('elt, 'partial)
interruptible_worker = subtask_id * 'elt -> 'partial option
Workers that can be aborted asynchronously
type
kill = subtask_id Join.chan
To abort given subtask
module type S = sig
.. end
Output signature of the pool functor
module Make: functor (
C
:
Config
) ->
functor (
E
:
Enumerable
) ->
S
with type elt = E.elt and type collection = E.t
Functor to build pools, given an enumeration technique specification (E
)