-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
16 additions
and
6 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
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>FLS (picos.Picos.Fiber.FLS)</title><meta charset="utf-8"/><link rel="stylesheet" href="../../../../_odoc-theme/odoc.css"/><meta name="generator" content="odoc 2.4.3"/><meta name="viewport" content="width=device-width,initial-scale=1.0"/><script src="../../../../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">picos</a> » <a href="../../index.html">Picos</a> » <a href="../index.html">Fiber</a> » FLS</nav><header class="odoc-preamble"><h1>Module <code><span>Fiber.FLS</span></code></h1><p>Fiber local storage</p><p>Fiber local storage is intended for use as a low overhead storage mechanism for fiber extensions. For example, one might associate a priority value with each fiber for a scheduler that uses a priority queue or one might use FLS to store unique id values for fibers.</p></header><div class="odoc-content"><div class="odoc-spec"><div class="spec type subst anchored" id="type-fiber"><a href="#type-fiber" class="anchor"></a><code><span><span class="keyword">type</span> fiber</span><span> := <a href="../index.html#type-t">t</a></span></code></div><div class="spec-doc"><p>Destructively substituted alias for <a href="../index.html#type-t"><code>Fiber.t</code></a>.</p></div></div><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> <span>'a t</span></span></code></div><div class="spec-doc"><p>Represents a key for storing values of type <code>'a</code> in storage associated with fibers.</p></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-create"><a href="#val-create" class="anchor"></a><code><span><span class="keyword">val</span> create : <span>unit <span class="arrow">-></span></span> <span><span class="type-var">'a</span> <a href="#type-t">t</a></span></span></code></div><div class="spec-doc"><p><code>new_key initial</code> allocates a new key for associating values in storage associated with fibers. The <code>initial</code> value for every fiber is either the given <code>Constant</code> or is <code>Computed</code> with the given function. If the initial value is a constant, no value needs to be stored unless the value is explicitly updated.</p><p>⚠️ New keys should not be created dynamically.</p></div></div><div class="odoc-spec"><div class="spec exception anchored" id="exception-Not_set"><a href="#exception-Not_set" class="anchor"></a><code><span><span class="keyword">exception</span> </span><span><span class="exception">Not_set</span></span></code></div><div class="spec-doc"><p>Raised by <a href="#val-get_exn"><code>get_exn</code></a> in case value has not been <a href="#val-set"><code>set</code></a>.</p></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-get_exn"><a href="#val-get_exn" class="anchor"></a><code><span><span class="keyword">val</span> get_exn : <span><a href="#type-fiber">fiber</a> <span class="arrow">-></span></span> <span><span><span class="type-var">'a</span> <a href="#type-t">t</a></span> <span class="arrow">-></span></span> <span class="type-var">'a</span></span></code></div><div class="spec-doc"><p><code>get_exn fiber key</code> returns the value associated with the <code>key</code> in the storage associated with the <code>fiber</code> or raises <a href="#exception-Not_set"><code>Not_set</code></a> using <code>raise_notrace</code>.</p><p>⚠️ It is only safe to call <code>get_exn</code> from the fiber itself or when the fiber is known not to be running.</p></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-get"><a href="#val-get" class="anchor"></a><code><span><span class="keyword">val</span> get : <span><a href="#type-fiber">fiber</a> <span class="arrow">-></span></span> <span><span><span class="type-var">'a</span> <a href="#type-t">t</a></span> <span class="arrow">-></span></span> <span><span class="label">default</span>:<span class="type-var">'a</span> <span class="arrow">-></span></span> <span class="type-var">'a</span></span></code></div><div class="spec-doc"><p><code>get fiber key ~default</code> returns the value associated with the <code>key</code> in the storage associated with the <code>fiber</code> or the <code>default</code> value.</p><p>⚠️ It is only safe to call <code>get</code> from the fiber itself or when the fiber is known not to be running.</p></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-set"><a href="#val-set" class="anchor"></a><code><span><span class="keyword">val</span> set : <span><a href="#type-fiber">fiber</a> <span class="arrow">-></span></span> <span><span><span class="type-var">'a</span> <a href="#type-t">t</a></span> <span class="arrow">-></span></span> <span><span class="type-var">'a</span> <span class="arrow">-></span></span> unit</span></code></div><div class="spec-doc"><p><code>set fiber key value</code> sets the <code>value</code> associated with the <code>key</code> to the given value in the storage associated with the <code>fiber</code>.</p><p>⚠️ It is only safe to call <code>set</code> from the fiber itself or when the fiber is known not to be running.</p></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-remove"><a href="#val-remove" class="anchor"></a><code><span><span class="keyword">val</span> remove : <span><a href="#type-fiber">fiber</a> <span class="arrow">-></span></span> <span><span><span class="type-var">'a</span> <a href="#type-t">t</a></span> <span class="arrow">-></span></span> unit</span></code></div><div class="spec-doc"><p><code>remove fiber key</code> removes the value, if any, associated with the <code>key</code> from the storage associated with the <code>fiber</code>.</p><p>⚠️ It is only safe to call <code>remove</code> from the fiber itself or when the fiber is known not to be running.</p></div></div></div></body></html> | ||
<html xmlns="http://www.w3.org/1999/xhtml"><head><title>FLS (picos.Picos.Fiber.FLS)</title><meta charset="utf-8"/><link rel="stylesheet" href="../../../../_odoc-theme/odoc.css"/><meta name="generator" content="odoc 2.4.3"/><meta name="viewport" content="width=device-width,initial-scale=1.0"/><script src="../../../../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">picos</a> » <a href="../../index.html">Picos</a> » <a href="../index.html">Fiber</a> » FLS</nav><header class="odoc-preamble"><h1>Module <code><span>Fiber.FLS</span></code></h1><p>Fiber local storage</p><p>Fiber local storage is intended for use as a low overhead storage mechanism for fiber extensions. For example, one might associate a priority value with each fiber for a scheduler that uses a priority queue or one might use FLS to store unique id values for fibers.</p></header><div class="odoc-content"><div class="odoc-spec"><div class="spec type subst anchored" id="type-fiber"><a href="#type-fiber" class="anchor"></a><code><span><span class="keyword">type</span> fiber</span><span> := <a href="../index.html#type-t">t</a></span></code></div><div class="spec-doc"><p>Destructively substituted alias for <a href="../index.html#type-t"><code>Fiber.t</code></a>.</p></div></div><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> <span>'a t</span></span></code></div><div class="spec-doc"><p>Represents a key for storing values of type <code>'a</code> in storage associated with fibers.</p></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-create"><a href="#val-create" class="anchor"></a><code><span><span class="keyword">val</span> create : <span>unit <span class="arrow">-></span></span> <span><span class="type-var">'a</span> <a href="#type-t">t</a></span></span></code></div><div class="spec-doc"><p><code>new_key initial</code> allocates a new key for associating values in storage associated with fibers. The <code>initial</code> value for every fiber is either the given <code>Constant</code> or is <code>Computed</code> with the given function. If the initial value is a constant, no value needs to be stored unless the value is explicitly updated.</p><p>⚠️ New keys should not be created dynamically.</p></div></div><div class="odoc-spec"><div class="spec exception anchored" id="exception-Not_set"><a href="#exception-Not_set" class="anchor"></a><code><span><span class="keyword">exception</span> </span><span><span class="exception">Not_set</span></span></code></div><div class="spec-doc"><p>Raised by <a href="#val-get_exn"><code>get_exn</code></a> in case value has not been <a href="#val-set"><code>set</code></a>.</p></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-get_exn"><a href="#val-get_exn" class="anchor"></a><code><span><span class="keyword">val</span> get_exn : <span><a href="#type-fiber">fiber</a> <span class="arrow">-></span></span> <span><span><span class="type-var">'a</span> <a href="#type-t">t</a></span> <span class="arrow">-></span></span> <span class="type-var">'a</span></span></code></div><div class="spec-doc"><p><code>get_exn fiber key</code> returns the value associated with the <code>key</code> in the storage associated with the <code>fiber</code> or raises <a href="#exception-Not_set"><code>Not_set</code></a> using <code>raise_notrace</code>.</p><p>⚠️ It is only safe to call <code>get_exn</code> from the fiber itself or when the fiber is known not to be running.</p></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-get"><a href="#val-get" class="anchor"></a><code><span><span class="keyword">val</span> get : <span><a href="#type-fiber">fiber</a> <span class="arrow">-></span></span> <span><span><span class="type-var">'a</span> <a href="#type-t">t</a></span> <span class="arrow">-></span></span> <span><span class="label">default</span>:<span class="type-var">'a</span> <span class="arrow">-></span></span> <span class="type-var">'a</span></span></code></div><div class="spec-doc"><p><code>get fiber key ~default</code> returns the value associated with the <code>key</code> in the storage associated with the <code>fiber</code> or the <code>default</code> value.</p><p>⚠️ It is only safe to call <code>get</code> from the fiber itself or when the fiber is known not to be running.</p></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-set"><a href="#val-set" class="anchor"></a><code><span><span class="keyword">val</span> set : <span><a href="#type-fiber">fiber</a> <span class="arrow">-></span></span> <span><span><span class="type-var">'a</span> <a href="#type-t">t</a></span> <span class="arrow">-></span></span> <span><span class="type-var">'a</span> <span class="arrow">-></span></span> unit</span></code></div><div class="spec-doc"><p><code>set fiber key value</code> sets the <code>value</code> associated with the <code>key</code> to the given value in the storage associated with the <code>fiber</code>.</p><p>⚠️ It is only safe to call <code>set</code> from the fiber itself or when the fiber is known not to be running.</p></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-remove"><a href="#val-remove" class="anchor"></a><code><span><span class="keyword">val</span> remove : <span><a href="#type-fiber">fiber</a> <span class="arrow">-></span></span> <span><span><span class="type-var">'a</span> <a href="#type-t">t</a></span> <span class="arrow">-></span></span> unit</span></code></div><div class="spec-doc"><p><code>remove fiber key</code> removes the value, if any, associated with the <code>key</code> from the storage associated with the <code>fiber</code>.</p><p>⚠️ It is only safe to call <code>remove</code> from the fiber itself or when the fiber is known not to be running.</p></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-reserve"><a href="#val-reserve" class="anchor"></a><code><span><span class="keyword">val</span> reserve : <span><a href="#type-fiber">fiber</a> <span class="arrow">-></span></span> <span><span><span class="type-var">'a</span> <a href="#type-t">t</a></span> <span class="arrow">-></span></span> unit</span></code></div><div class="spec-doc"><p><code>reserve fiber key</code> ensures that sufficient space has been allocated to associate a value with the specified <code>key</code> such that a subsequent <a href="#val-set"><code>set</code></a> with the <code>key</code> will not allocate.</p><p>ℹ️ This can be used to optimize the population of the FLS and to avoid performing memory allocations in critical sections.</p><p>⚠️ It is only safe to call <code>reserve</code> from the fiber itself or when the fiber is known not to be running.</p></div></div></div></body></html> |
Oops, something went wrong.