aboutsummaryrefslogtreecommitdiffhomepage
path: root/stm/asyncTaskQueue.mli
diff options
context:
space:
mode:
authorGravatar Enrico Tassi <Enrico.Tassi@inria.fr>2014-12-16 18:23:44 +0100
committerGravatar Enrico Tassi <Enrico.Tassi@inria.fr>2014-12-17 15:05:05 +0100
commit4618ab9961fc196a1f1912ed1b6b140eb8b4d407 (patch)
tree2c04f9ea402d8b65a072e0e6d1b6fc86f5fa0dbe /stm/asyncTaskQueue.mli
parent77472779450b218711aa7024feafc19054371eaa (diff)
AsyncTaskQueue: simpler model (no parking area, continuation tasks)
Diffstat (limited to 'stm/asyncTaskQueue.mli')
-rw-r--r--stm/asyncTaskQueue.mli15
1 files changed, 7 insertions, 8 deletions
diff --git a/stm/asyncTaskQueue.mli b/stm/asyncTaskQueue.mli
index ee364ff19..7a2743e53 100644
--- a/stm/asyncTaskQueue.mli
+++ b/stm/asyncTaskQueue.mli
@@ -6,7 +6,7 @@
(* * GNU Lesser General Public License Version 2.1 *)
(************************************************************************)
-type 'a worker_status = [ `Fresh | `Old | `Parked of 'a ]
+type 'a worker_status = [ `Fresh | `Old of 'a ]
module type Task = sig
@@ -25,10 +25,9 @@ module type Task = sig
val task_match : competence worker_status -> task -> bool
val use_response :
competence worker_status -> task -> response ->
- [ `Stay | `Park of competence | `Reset ]
+ [ `Stay of competence * task list | `End ]
val on_marshal_error : string -> task -> unit
- val on_slave_death : task option -> [ `Exit of int | `Stay ]
- val on_task_cancellation_or_expiration : task option -> unit
+ val on_task_cancellation_or_expiration_or_slave_death : task option -> unit
val forward_feedback : Feedback.feedback -> unit
(* run by the worker *)
@@ -40,7 +39,7 @@ module type Task = sig
end
-type cancel_switch = bool ref
+type expiration = bool ref
module MakeQueue(T : Task) : sig
@@ -50,15 +49,15 @@ module MakeQueue(T : Task) : sig
val create : int -> queue
val destroy : queue -> unit
- val n_workers : queue -> int * int (* active, parked *)
+ val n_workers : queue -> int
- val enqueue_task : queue -> T.task -> cancel_switch -> unit
+ val enqueue_task : queue -> T.task * expiration -> unit
(* blocking function that waits for the task queue to be empty *)
val join : queue -> unit
val cancel_all : queue -> unit
- val cancel_worker : queue -> string -> unit
+ val cancel_worker : queue -> WorkerPool.worker_id -> unit
val set_order : queue -> (T.task -> T.task -> int) -> unit