package rocq-runtime
Install
Dune Dependency
Authors
Maintainers
Sources
md5=8d522602d23e7a665631826dab9aa92b
sha512=f4f76a6a178e421c99ee7a331a2fd97a06e9c5d0168d7e60c44e3820d8e1a124370ea104ad90c7f87a9a1e9d87b2d0d7d2d387c998feeaed4a75ed04e176a4be
doc/rocq-runtime.stm/AsyncTaskQueue/index.html
Module AsyncTaskQueue
Source
This file provides an API for defining and managing a queue of tasks to be done by external workers.
A queue of items of type task
is maintained, then for each task, a request is generated, then sent to a worker using marshalling.
The workers will then eventually return a result, using marshalling again: ____ ____ ____ ________ | T1 | T2 | T3 | => request
=> | Worker | |____|____|____| <= response
<= |________| | Master Proc. | \--------------/
Thus request
and response
must be safely marshallable.
Operations for managing the task queue are provide, see below for more details.
The Task
module type defines an abstract message-processing queue.
cancel_switch
to be flipped to true by anyone to signal the task is not relevant anymore. When the STM performs an undo/edit-at, it crawls the document and flips these flags (the Qed node carries a pointer to the flag IIRC).
Client-side functor. MakeQueue T
creates a task queue for task T
Server-side functor. MakeWorker T
creates the server task dispatcher.