Skip to content

Commit

Permalink
Generate (by hands) documentation from fd00a15
Browse files Browse the repository at this point in the history
  • Loading branch information
dinosaure committed Sep 5, 2023
1 parent 203049b commit a00c323
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion miou/Miou/Promise/index.html
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Promise (miou.Miou.Promise)</title><link rel="stylesheet" href="../../../odoc.support/odoc.css"/><meta charset="utf-8"/><meta name="generator" content="odoc 2.2.0"/><meta name="viewport" content="width=device-width,initial-scale=1.0"/><script src="../../../odoc.support/highlight.pack.js"></script><script>hljs.initHighlightingOnLoad();</script></head><body class="odoc"><nav class="odoc-nav"><a href="../index.html">Up</a><a href="../../index.html">miou</a> &#x00BB; <a href="../index.html">Miou</a> &#x00BB; Promise</nav><header class="odoc-preamble"><h1>Module <code><span>Miou.Promise</span></code></h1></header><div class="odoc-content"><div class="odoc-spec"><div class="spec module anchored" id="module-Uid"><a href="#module-Uid" class="anchor"></a><code><span><span class="keyword">module</span> <a href="Uid/index.html">Uid</a></span><span> : <span class="keyword">sig</span> ... <span class="keyword">end</span></span></code></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-pp"><a href="#val-pp" class="anchor"></a><code><span><span class="keyword">val</span> pp : <span><span class="xref-unresolved">Stdlib</span>.Format.formatter <span class="arrow">&#45;&gt;</span></span> <span><span><span class="type-var">'a</span> <a href="../index.html#type-t">t</a></span> <span class="arrow">&#45;&gt;</span></span> unit</span></code></div></div></div></body></html>
<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Promise (miou.Miou.Promise)</title><link rel="stylesheet" href="../../../odoc.support/odoc.css"/><meta charset="utf-8"/><meta name="generator" content="odoc 2.2.0"/><meta name="viewport" content="width=device-width,initial-scale=1.0"/><script src="../../../odoc.support/highlight.pack.js"></script><script>hljs.initHighlightingOnLoad();</script></head><body class="odoc"><nav class="odoc-nav"><a href="../index.html">Up</a><a href="../../index.html">miou</a> &#x00BB; <a href="../index.html">Miou</a> &#x00BB; Promise</nav><header class="odoc-preamble"><h1>Module <code><span>Miou.Promise</span></code></h1></header><div class="odoc-content"><div class="odoc-spec"><div class="spec module anchored" id="module-Uid"><a href="#module-Uid" class="anchor"></a><code><span><span class="keyword">module</span> <a href="Uid/index.html">Uid</a></span><span> : <span class="keyword">sig</span> ... <span class="keyword">end</span></span></code></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-pp"><a href="#val-pp" class="anchor"></a><code><span><span class="keyword">val</span> pp : <span><span class="xref-unresolved">Stdlib</span>.Format.formatter <span class="arrow">&#45;&gt;</span></span> <span><span><span class="type-var">'a</span> <a href="../index.html#type-t">t</a></span> <span class="arrow">&#45;&gt;</span></span> unit</span></code></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-uid"><a href="#val-uid" class="anchor"></a><code><span><span class="keyword">val</span> uid : <span><span><span class="type-var">'a</span> <a href="../index.html#type-t">t</a></span> <span class="arrow">&#45;&gt;</span></span> <a href="Uid/index.html#type-t">Uid.t</a></span></code></div></div></div></body></html>
5 changes: 4 additions & 1 deletion miou/Miou/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,10 @@
Miou.await_one
[ Miou.call_cc (Fun.const 1)
; Miou.call_cc (Fun.const 2) ] ;;
Exception: Miou.Still_has_children</code></pre></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-yield"><a href="#val-yield" class="anchor"></a><code><span><span class="keyword">val</span> yield : <span>unit <span class="arrow">&#45;&gt;</span></span> unit</span></code></div><div class="spec-doc"><p><code>yield ()</code> reschedules tasks and give an opportunity to carry out the tasks that have been on hold the longest. For intance:</p><pre class="language-ocaml"><code># Miou.run @@ fun () -&gt;
Exception: Miou.Still_has_children</code></pre></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-both"><a href="#val-both" class="anchor"></a><code><span><span class="keyword">val</span> both : <span><span><span class="type-var">'a</span> <a href="#type-t">t</a></span> <span class="arrow">&#45;&gt;</span></span> <span><span><span class="type-var">'b</span> <a href="#type-t">t</a></span> <span class="arrow">&#45;&gt;</span></span> <span><span>(<span class="type-var">'a</span>, exn)</span> <span class="xref-unresolved">Stdlib</span>.result</span> * <span><span>(<span class="type-var">'b</span>, exn)</span> <span class="xref-unresolved">Stdlib</span>.result</span></span></code></div><div class="spec-doc"><p><code>both prm0 prm1</code> waits <code>prm0</code> <b>and</b>) <code>prm1</code>. It's equivalent to:</p><pre class="language-ocaml"><code>let both prm0 prm1 =
let a = Miou.await prm0 in
let b = Miou.await prm1 in
(a, b)</code></pre></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-yield"><a href="#val-yield" class="anchor"></a><code><span><span class="keyword">val</span> yield : <span>unit <span class="arrow">&#45;&gt;</span></span> unit</span></code></div><div class="spec-doc"><p><code>yield ()</code> reschedules tasks and give an opportunity to carry out the tasks that have been on hold the longest. For intance:</p><pre class="language-ocaml"><code># Miou.run @@ fun () -&gt;
let p = Miou.call_cc @@ fun () -&gt; print_endline &quot;Hello&quot; in
print_endline &quot;World&quot;;
Miou.await_exn p ;;
Expand Down
2 changes: 1 addition & 1 deletion miou/Miou_unix/Cond/index.html
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Cond (miou.Miou_unix.Cond)</title><link rel="stylesheet" href="../../../odoc.support/odoc.css"/><meta charset="utf-8"/><meta name="generator" content="odoc 2.2.0"/><meta name="viewport" content="width=device-width,initial-scale=1.0"/><script src="../../../odoc.support/highlight.pack.js"></script><script>hljs.initHighlightingOnLoad();</script></head><body class="odoc"><nav class="odoc-nav"><a href="../index.html">Up</a><a href="../../index.html">miou</a> &#x00BB; <a href="../index.html">Miou_unix</a> &#x00BB; Cond</nav><header class="odoc-preamble"><h1>Module <code><span>Miou_unix.Cond</span></code></h1><p>Due to our scheduler, we must re-implement few things like &quot;Condition&quot; to be able to wait and signal (or broadcast) our tasks. The suspension of a task must always be notified to Miou. It is possible to use real <code>Condition</code>.t with Miou - however, some mechanisms such as cancellation will not work.</p><p>This module reimplements the <code>Condition</code> with Miou. The behaviour remains the same, except that the user can <a href="../../Miou/index.html#val-cancel"><code>Miou.cancel</code></a> a task while it is waiting for a signal/broadcast.</p></header><div class="odoc-content"><div class="odoc-spec"><div class="spec type anchored" id="type-t"><a href="#type-t" class="anchor"></a><code><span><span class="keyword">type</span> t</span></code></div><div class="spec-doc"><p>The type of condition variables.</p></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-make"><a href="#val-make" class="anchor"></a><code><span><span class="keyword">val</span> make : <span>?mutex:<span class="xref-unresolved">Stdlib</span>.Mutex.t <span class="arrow">&#45;&gt;</span></span> <span>unit <span class="arrow">&#45;&gt;</span></span> <a href="#type-t">t</a></span></code></div><div class="spec-doc"><p><code>make ?mutex ()</code> creates and return a new condition variable. A condition needs a <code>Mutex</code>.t to have internal inter-domain synchronization mechanisms. This mutex can be used by several conditions <a href="#type-t"><code>t</code></a>, so it is possible to specify your own <code>Mutex</code>.t instead of letting Miou create one.</p></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-wait"><a href="#val-wait" class="anchor"></a><code><span><span class="keyword">val</span> wait : <span>predicate:<span>(<span>unit <span class="arrow">&#45;&gt;</span></span> bool)</span> <span class="arrow">&#45;&gt;</span></span> <span><a href="#type-t">t</a> <span class="arrow">&#45;&gt;</span></span> bool</span></code></div><div class="spec-doc"><p><code>wait ~predicate t</code> suspends the current task on the condition variable <code>t</code>. The task can later be woken up after the condition variable <code>t</code> has been signaled via <a href="#val-signal"><code>signal</code></a> or <a href="#val-broadcast"><code>broadcast</code></a>. <code>predicate</code> is a function which is executed <b>before</b> the wait to test if we need to wait or not and <b>protected</b> by the internal <code>Mutex</code>.t (see <a href="#val-make"><code>make</code></a>).</p></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-until"><a href="#val-until" class="anchor"></a><code><span><span class="keyword">val</span> until : <span>predicate:<span>(<span>unit <span class="arrow">&#45;&gt;</span></span> bool)</span> <span class="arrow">&#45;&gt;</span></span> <span>fn:<span>(<span>unit <span class="arrow">&#45;&gt;</span></span> <span class="type-var">'a</span>)</span> <span class="arrow">&#45;&gt;</span></span> <span><a href="#type-t">t</a> <span class="arrow">&#45;&gt;</span></span> <span class="type-var">'a</span></span></code></div><div class="spec-doc"><p><code>until ~predicate ~fn t</code> waits as long as <code>predicate</code> is <code>true</code>. Then, we execute <code>fn</code> as soon as the process has unblocked. The execution of <code>predicate</code> and <code>fn</code> is protected by the mutex internal to condition <code>t</code>.</p></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-signal"><a href="#val-signal" class="anchor"></a><code><span><span class="keyword">val</span> signal : <span><a href="#type-t">t</a> <span class="arrow">&#45;&gt;</span></span> unit</span></code></div><div class="spec-doc"><p><code>signal t</code> wakes up one of the tasks waiting on the condition variable <code>t</code>, if there is one. if there is none, this call has no effect.</p></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-broadcast"><a href="#val-broadcast" class="anchor"></a><code><span><span class="keyword">val</span> broadcast : <span><a href="#type-t">t</a> <span class="arrow">&#45;&gt;</span></span> unit</span></code></div><div class="spec-doc"><p><code>broadcast t</code> wakes up <b>all</b> tasks waiting on the condition variable <code>t</code>, if there is one. If there is none, this call has no effect.</p></div></div></div></body></html>
<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Cond (miou.Miou_unix.Cond)</title><link rel="stylesheet" href="../../../odoc.support/odoc.css"/><meta charset="utf-8"/><meta name="generator" content="odoc 2.2.0"/><meta name="viewport" content="width=device-width,initial-scale=1.0"/><script src="../../../odoc.support/highlight.pack.js"></script><script>hljs.initHighlightingOnLoad();</script></head><body class="odoc"><nav class="odoc-nav"><a href="../index.html">Up</a><a href="../../index.html">miou</a> &#x00BB; <a href="../index.html">Miou_unix</a> &#x00BB; Cond</nav><header class="odoc-preamble"><h1>Module <code><span>Miou_unix.Cond</span></code></h1><p>Due to our scheduler, we must re-implement few things like &quot;Condition&quot; to be able to wait and signal (or broadcast) our tasks. The suspension of a task must always be notified to Miou. It is possible to use real <code>Condition</code>.t with Miou - however, some mechanisms such as cancellation will not work.</p><p>This module reimplements the <code>Condition</code> with Miou. The behaviour remains the same, except that the user can <a href="../../Miou/index.html#val-cancel"><code>Miou.cancel</code></a> a task while it is waiting for a signal/broadcast.</p></header><div class="odoc-content"><div class="odoc-spec"><div class="spec type anchored" id="type-t"><a href="#type-t" class="anchor"></a><code><span><span class="keyword">type</span> t</span></code></div><div class="spec-doc"><p>The type of condition variables.</p></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-make"><a href="#val-make" class="anchor"></a><code><span><span class="keyword">val</span> make : <span>?mutex:<span class="xref-unresolved">Stdlib</span>.Mutex.t <span class="arrow">&#45;&gt;</span></span> <span>unit <span class="arrow">&#45;&gt;</span></span> <a href="#type-t">t</a></span></code></div><div class="spec-doc"><p><code>make ?mutex ()</code> creates and return a new condition variable. The mutex is used in the <a href="#val-until"><code>until</code></a> function to observe the validity of a predicate. It is recommended that any change of state of this predicate should be protected by this same mutex.</p></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-wait"><a href="#val-wait" class="anchor"></a><code><span><span class="keyword">val</span> wait : <span><a href="#type-t">t</a> <span class="arrow">&#45;&gt;</span></span> unit</span></code></div><div class="spec-doc"><p><code>wait t</code> suspends the current task on the condition variable <code>t</code>. The task can later be woken up after the condition variable <code>t</code> has been signaled via <a href="#val-signal"><code>signal</code></a> or <a href="#val-broadcast"><code>broadcast</code></a>. <a href="#val-wait"><code>wait</code></a> does <b>not</b> lock the internal mutex passed as a parameter to the <a href="#val-make"><code>make</code></a> function. Spurious wakeups does not happen - only <a href="#val-signal"><code>signal</code></a> or <a href="#val-broadcast"><code>broadcast</code></a> can wakeup the task.</p><p><b>NOTE</b>: A signal can be sent <b>before</b> the other task <a href="#val-wait"><code>wait</code></a>s. In this case (and according to our documentation), if you only intend to send one signal, the other task will still be suspended.</p></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-until"><a href="#val-until" class="anchor"></a><code><span><span class="keyword">val</span> until : <span>predicate:<span>(<span>unit <span class="arrow">&#45;&gt;</span></span> bool)</span> <span class="arrow">&#45;&gt;</span></span> <span>fn:<span>(<span>unit <span class="arrow">&#45;&gt;</span></span> <span class="type-var">'a</span>)</span> <span class="arrow">&#45;&gt;</span></span> <span><a href="#type-t">t</a> <span class="arrow">&#45;&gt;</span></span> <span class="type-var">'a</span></span></code></div><div class="spec-doc"><p><code>until ~predicate ~fn t</code> waits as long as <code>predicate</code> is <code>true</code>. Then, we execute <code>fn</code> as soon as the process has unblocked. The execution of <code>predicate</code> and <code>fn</code> is protected by the mutex internal to condition <code>t</code> (passed as a parameter to the <a href="#val-make"><code>make</code></a> function).</p><p><b>NOTE</b>: The function <code>fn</code> should recheck the <code>predicate</code>. Indeed, in parallel programming (see <a href="../../Miou/index.html#val-call"><code>Miou.call</code></a>), it can happen that a domain re-invalidates the expected predicate before <code>fn</code> is executed.</p></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-signal"><a href="#val-signal" class="anchor"></a><code><span><span class="keyword">val</span> signal : <span><a href="#type-t">t</a> <span class="arrow">&#45;&gt;</span></span> unit</span></code></div><div class="spec-doc"><p><code>signal t</code> wakes up one of the tasks waiting on the condition variable <code>t</code>, if there is one. if there is none, this call has no effect.</p></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-broadcast"><a href="#val-broadcast" class="anchor"></a><code><span><span class="keyword">val</span> broadcast : <span><a href="#type-t">t</a> <span class="arrow">&#45;&gt;</span></span> unit</span></code></div><div class="spec-doc"><p><code>broadcast t</code> wakes up <b>all</b> tasks waiting on the condition variable <code>t</code>, if there is one. If there is none, this call has no effect.</p></div></div></div></body></html>

0 comments on commit a00c323

Please sign in to comment.