(************************************************************************) (* * The Rocq Prover / The Rocq Development Team *) (* v * Copyright INRIA, CNRS and contributors *) (* <O___,, * (see version control and CREDITS file for authors & dates) *) (* \VV/ **************************************************************) (* // * This file is distributed under the terms of the *) (* * GNU Lesser General Public License Version 2.1 *) (* * (see LICENSE file for the text of the license) *) (************************************************************************)
(* Default flags for workers *) val async_proofs_flags_for_workers : stringlistref
(** This file provides an API for defining and managing a queue of taskstobedonebyexternalworkers.
Thisallowstoimplementbothone-shotworkersand"persistent" ones.E.g.par:isimplementusingworkersthatdon't "reboot".Proofworkersdorebootmainlybecausethevmhassome Cstatethatcannotbecleared,soyouhavearealmemoryleakif
you don't reboot the worker. *) type worker_status = Fresh | Old of competence
(** Type of input and output data for workers.
Thedatamustbemarshallableasitsendthroughthenetwork
using [Marshal] . *) type request type response
(** UID of the task kind *) val name : string
(** Extra arguments of the task kind *) val extra_env : unit -> string array
(** {5 Master API, it is run by the master, on a thread} *)
(** [request_of_task status t] takes the [status] of the worker andatask[t]andcreatesthecorresponding[Somerequest]tobe
sent to the worker or it is not valid anymore [None]. *) val request_of_task : worker_status -> task -> request option
(** [task_match status tid] Allows to discard tasks based on the
worker status. *) val task_match : worker_status -> task -> bool
E.g.mastercandecidetoinhabitthe(delegate)Future.twitha closure(toberuninmaster),i.e.makethedocumentstill
checkable. This is what I do for marshaling errors. *) val on_task_cancellation_or_expiration_or_slave_death : task option -> unit
(** [forward_feedback fb] sends fb to all the workers. *) val forward_feedback : Feedback.feedback -> unit
(** {5 Worker API, it is run by worker, on a different fresh
process} *)
(** [perform in] synchronously processes a request [in] *) val perform : request -> response
(** debugging *) val name_of_task : task -> string val name_of_request : request -> string
end
(** [cancel_switch] to be flipped to true by anyone to signal the task isnotrelevantanymore.WhentheSTMperformsanundo/edit-at,it crawlsthedocumentandflipstheseflags(theQednodecarriesa pointertotheflagIIRC).
*) type cancel_switch = boolref
(** Client-side functor. [MakeQueue T] creates a task queue for task [T] *)
module MakeQueue(T : Task) () : sig
(** [queue] is the abstract queue type. *) type queue
(** [create n pri] will initialize the queue with [n] workers having priority[pri].If[n]is0,thequeuewon'tspawnanyprocess,
working in a lazy local manner. [not imposed by the this API] *) val create : spawn_args:stringlist -> int -> CoqworkmgrApi.priority -> queue
(** [destroy q] Deallocates [q], cancelling all pending tasks. *) val destroy : queue -> unit
(** [n_workers q] returns the number of workers of [q] *) val n_workers : queue -> int
(** [enqueue_task q t ~cancel_switch] schedules [t] for execution in
[q]. [cancel_switch] can be flipped to true to cancel the task. *) val enqueue_task : queue -> T.task -> cancel_switch:cancel_switch -> unit
(** [join q] blocks until the task queue is empty *) val join : queue -> unit
(** [cancel_all q] Cancels all tasks *) val cancel_all : queue -> unit
(** [cancel_worker q wid] cancels a particular worker [wid] *) val cancel_worker : queue -> WorkerPool.worker_id -> unit
(** [set_order q cmp] reorders [q] using ordering [cmp] *) val set_order : queue -> (T.task -> T.task -> int) -> unit
ThisAPIiscrucialtoCoqoon(oranyotherUIthatinvokes Stm.finisheagerlybutwantstheworkersto"focus"onthevisible partofthedocument).
*) val broadcast : queue -> unit
(** [snapshot q] Takes a snapshot (non destructive but waits until
all workers are enqueued) *) val snapshot : queue -> T.task list
(** [clear q] Clears [q], only if the worker prool is empty *) val clear : queue -> unit
(** [with_n_workers n pri f] creates a queue, runs the function, destroys
the queue. The user should call join *) val with_n_workers : spawn_args:stringlist -> int -> CoqworkmgrApi.priority -> (queue -> 'a) -> 'a
end
(** Server-side functor. [MakeWorker T] creates the server task
dispatcher. *)
module MakeWorker(_ : Task) () : sig
(** [init_stdout ()] is called at [Coqtop.toploop_init] time. *) val init_stdout : unit -> unit
(** [main_loop ()] is called at [Coqtop.toploop_run] time. *) val main_loop : unit -> unit
end
(** convenience exception to marshall to master *)
exception RemoteException of Pp.t
Messung V0.5 in Prozent
¤ Dauer der Verarbeitung: 0.12 Sekunden
(vorverarbeitet am 2026-09-27)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.