-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Generate (by hands) documentation from fd00a15
- Loading branch information
Showing
3 changed files
with
6 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> » <a href="../index.html">Miou</a> » 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">-></span></span> <span><span><span class="type-var">'a</span> <a href="../index.html#type-t">t</a></span> <span class="arrow">-></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> » <a href="../index.html">Miou</a> » 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">-></span></span> <span><span><span class="type-var">'a</span> <a href="../index.html#type-t">t</a></span> <span class="arrow">-></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">-></span></span> <a href="Uid/index.html#type-t">Uid.t</a></span></code></div></div></div></body></html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> » <a href="../index.html">Miou_unix</a> » 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 "Condition" 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">-></span></span> <span>unit <span class="arrow">-></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">-></span></span> bool)</span> <span class="arrow">-></span></span> <span><a href="#type-t">t</a> <span class="arrow">-></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">-></span></span> bool)</span> <span class="arrow">-></span></span> <span>fn:<span>(<span>unit <span class="arrow">-></span></span> <span class="type-var">'a</span>)</span> <span class="arrow">-></span></span> <span><a href="#type-t">t</a> <span class="arrow">-></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">-></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">-></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> » <a href="../index.html">Miou_unix</a> » 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 "Condition" 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">-></span></span> <span>unit <span class="arrow">-></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">-></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">-></span></span> bool)</span> <span class="arrow">-></span></span> <span>fn:<span>(<span>unit <span class="arrow">-></span></span> <span class="type-var">'a</span>)</span> <span class="arrow">-></span></span> <span><a href="#type-t">t</a> <span class="arrow">-></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">-></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">-></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> |