You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

2 lines
21 KiB

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Concurrency__StarvationDomain (infer.Concurrency__StarvationDomain)</title><link rel="stylesheet" href="../../odoc.css"/><meta charset="utf-8"/><meta name="generator" content="odoc 1.5.1"/><meta name="viewport" content="width=device-width,initial-scale=1.0"/><script src="../../highlight.pack.js"></script><script>hljs.initHighlightingOnLoad();</script></head><body><div class="content"><header><nav><a href="../index.html">Up</a> <a href="../index.html">infer</a> &#x00BB; Concurrency__StarvationDomain</nav><h1>Module <code>Concurrency__StarvationDomain</code></h1></header><div class="spec module" id="module-F"><a href="#module-F" class="anchor"></a><code><span class="keyword">module</span> F = Stdlib.Format</code></div><dl><dt class="spec module" id="module-ThreadDomain"><a href="#module-ThreadDomain" class="anchor"></a><code><span class="keyword">module</span> <a href="ThreadDomain/index.html">ThreadDomain</a> : <span class="keyword">sig</span> ... <span class="keyword">end</span></code></dt><dd><p>Domain for thread-type. The main goals are</p></dd></dl><dl><dt class="spec module" id="module-Lock"><a href="#module-Lock" class="anchor"></a><code><span class="keyword">module</span> <a href="Lock/index.html">Lock</a> : <span class="keyword">sig</span> ... <span class="keyword">end</span></code></dt><dd><p>Abstract address for a lock. There are two notions of equality:</p></dd></dl><div class="spec module" id="module-VarDomain"><a href="#module-VarDomain" class="anchor"></a><code><span class="keyword">module</span> <a href="VarDomain/index.html">VarDomain</a> : <span class="keyword">sig</span> ... <span class="keyword">end</span></code></div><div class="spec module" id="module-Event"><a href="#module-Event" class="anchor"></a><code><span class="keyword">module</span> <a href="Event/index.html">Event</a> : <span class="keyword">sig</span> ... <span class="keyword">end</span></code></div><div class="spec module" id="module-LockState"><a href="#module-LockState" class="anchor"></a><code><span class="keyword">module</span> <a href="LockState/index.html">LockState</a> : <a href="../Absint/AbstractDomain/index.html#module-type-WithTop">Absint.AbstractDomain.WithTop</a></code></div><dl><dt class="spec module" id="module-Acquisition"><a href="#module-Acquisition" class="anchor"></a><code><span class="keyword">module</span> <a href="Acquisition/index.html">Acquisition</a> : <span class="keyword">sig</span> ... <span class="keyword">end</span></code></dt><dd><p>a lock acquisition with location information</p></dd></dl><dl><dt class="spec module" id="module-Acquisitions"><a href="#module-Acquisitions" class="anchor"></a><code><span class="keyword">module</span> <a href="Acquisitions/index.html">Acquisitions</a> : <span class="keyword">sig</span> ... <span class="keyword">end</span></code></dt><dd><p>A set of lock acquisitions with source locations and procnames.</p></dd></dl><dl><dt class="spec module" id="module-CriticalPairElement"><a href="#module-CriticalPairElement" class="anchor"></a><code><span class="keyword">module</span> <a href="CriticalPairElement/index.html">CriticalPairElement</a> : <span class="keyword">sig</span> ... <span class="keyword">end</span></code></dt><dd><p>An event and the currently-held locks at the time it occurred.</p></dd></dl><dl><dt class="spec module" id="module-CriticalPair"><a href="#module-CriticalPair" class="anchor"></a><code><span class="keyword">module</span> <a href="CriticalPair/index.html">CriticalPair</a> : <span class="keyword">sig</span> ... <span class="keyword">end</span></code></dt><dd><p>A <code>CriticalPairElement</code> equipped with a call stack. The intuition is that if we have a critical pair `(locks, event)` in the summary of a method then there is a trace of that method where `event` occurs, and right before it occurs the locks held are exactly `locks` (no over/under approximation). We call it &quot;critical&quot; because the information here alone determines deadlock conditions.</p></dd></dl><div class="spec module" id="module-CriticalPairs"><a href="#module-CriticalPairs" class="anchor"></a><code><span class="keyword">module</span> CriticalPairs : <a href="../Absint/AbstractDomain/index.html#module-type-FiniteSetS">Absint.AbstractDomain.FiniteSetS</a> <span class="keyword">with</span> <span class="keyword">type</span> <a href="../Absint/AbstractDomain/index.html#module-type-FiniteSetS">FiniteSetS</a>.elt = <a href="CriticalPair/index.html#type-t">CriticalPair.t</a></code></div><div class="spec module" id="module-GuardToLockMap"><a href="#module-GuardToLockMap" class="anchor"></a><code><span class="keyword">module</span> <a href="GuardToLockMap/index.html">GuardToLockMap</a> : <a href="../Absint/AbstractDomain/index.html#module-type-WithTop">Absint.AbstractDomain.WithTop</a></code></div><dl><dt class="spec module" id="module-Attribute"><a href="#module-Attribute" class="anchor"></a><code><span class="keyword">module</span> <a href="Attribute/index.html">Attribute</a> : <span class="keyword">sig</span> ... <span class="keyword">end</span></code></dt><dd><p>Tracks expression attributes</p></dd></dl><dl><dt class="spec module" id="module-AttributeDomain"><a href="#module-AttributeDomain" class="anchor"></a><code><span class="keyword">module</span> <a href="AttributeDomain/index.html">AttributeDomain</a> : <span class="keyword">sig</span> ... <span class="keyword">end</span></code></dt><dd><p>Tracks all expressions assigned values of <code>Attribute</code></p></dd></dl><dl><dt class="spec module" id="module-ScheduledWorkItem"><a href="#module-ScheduledWorkItem" class="anchor"></a><code><span class="keyword">module</span> <a href="ScheduledWorkItem/index.html">ScheduledWorkItem</a> : <span class="keyword">sig</span> ... <span class="keyword">end</span></code></dt><dd><p>A record of scheduled parallel work: the method scheduled to run, where, and on what thread.</p></dd></dl><div class="spec module" id="module-ScheduledWorkDomain"><a href="#module-ScheduledWorkDomain" class="anchor"></a><code><span class="keyword">module</span> ScheduledWorkDomain : <a href="../Absint/AbstractDomain/index.html#module-type-FiniteSetS">Absint.AbstractDomain.FiniteSetS</a> <span class="keyword">with</span> <span class="keyword">type</span> <a href="../Absint/AbstractDomain/index.html#module-type-FiniteSetS">FiniteSetS</a>.elt = <a href="ScheduledWorkItem/index.html#type-t">ScheduledWorkItem.t</a></code></div><dl><dt class="spec type" id="type-t"><a href="#type-t" class="anchor"></a><code><span class="keyword">type</span> t</code><code> = </code><code>{</code><table class="record"><tr id="type-t.guard_map" class="anchored"><td class="def field"><a href="#type-t.guard_map" class="anchor"></a><code>guard_map : <a href="GuardToLockMap/index.html#type-t">GuardToLockMap.t</a>;</code></td></tr><tr id="type-t.lock_state" class="anchored"><td class="def field"><a href="#type-t.lock_state" class="anchor"></a><code>lock_state : <a href="LockState/index.html#type-t">LockState.t</a>;</code></td></tr><tr id="type-t.critical_pairs" class="anchored"><td class="def field"><a href="#type-t.critical_pairs" class="anchor"></a><code>critical_pairs : <a href="index.html#module-CriticalPairs">CriticalPairs</a>.t;</code></td></tr><tr id="type-t.attributes" class="anchored"><td class="def field"><a href="#type-t.attributes" class="anchor"></a><code>attributes : <a href="AttributeDomain/index.html#type-t">AttributeDomain.t</a>;</code></td></tr><tr id="type-t.thread" class="anchored"><td class="def field"><a href="#type-t.thread" class="anchor"></a><code>thread : <a href="ThreadDomain/index.html#type-t">ThreadDomain.t</a>;</code></td></tr><tr id="type-t.scheduled_work" class="anchored"><td class="def field"><a href="#type-t.scheduled_work" class="anchor"></a><code>scheduled_work : <a href="index.html#module-ScheduledWorkDomain">ScheduledWorkDomain</a>.t;</code></td></tr><tr id="type-t.var_state" class="anchored"><td class="def field"><a href="#type-t.var_state" class="anchor"></a><code>var_state : <a href="VarDomain/index.html#type-t">VarDomain.t</a>;</code></td></tr></table><code>}</code></dt></dl><div><div class="spec include"><div class="doc"><details open="open"><summary><span class="def"><code><span class="keyword">include</span> <a href="../Absint/AbstractDomain/index.html#module-type-S">Absint.AbstractDomain.S</a> <span class="keyword">with</span> <span class="keyword">type</span> <a href="../Absint/AbstractDomain/module-type-S/index.html#type-t">t</a> := <a href="index.html#type-t">t</a></code></span></summary><div><div class="spec include"><div class="doc"><details open="open"><summary><span class="def"><code><span class="keyword">include</span> <a href="../Absint/AbstractDomain/index.html#module-type-NoJoin">Absint.AbstractDomain.NoJoin</a></code></span></summary><div><div class="spec include"><div class="doc"><details open="open"><summary><span class="def"><code><span class="keyword">include</span> <a href="../IStdlib/PrettyPrintable/index.html#module-type-PrintableType">IStdlib.PrettyPrintable.PrintableType</a></code></span></summary><dl><dt class="spec type" id="type-t"><a href="#type-t" class="anchor"></a><code><span class="keyword">type</span> t</code></dt></dl><dl><dt class="spec value" id="val-pp"><a href="#val-pp" class="anchor"></a><code><span class="keyword">val</span> pp : <a href="../IStdlib/PrettyPrintable/index.html#module-F">IStdlib.PrettyPrintable.F</a>.formatter <span>&#45;&gt;</span> <a href="index.html#type-t">t</a> <span>&#45;&gt;</span> unit</code></dt></dl></details></div></div></div><dl><dt class="spec value" id="val-leq"><a href="#val-leq" class="anchor"></a><code><span class="keyword">val</span> leq : <span>lhs:<a href="index.html#type-t">t</a></span> <span>&#45;&gt;</span> <span>rhs:<a href="index.html#type-t">t</a></span> <span>&#45;&gt;</span> bool</code></dt><dd><p>the implication relation: <code>lhs &lt;= rhs</code> means <code>lhs |- rhs</code></p></dd></dl></details></div></div></div><dl><dt class="spec value" id="val-join"><a href="#val-join" class="anchor"></a><code><span class="keyword">val</span> join : <a href="index.html#type-t">t</a> <span>&#45;&gt;</span> <a href="index.html#type-t">t</a> <span>&#45;&gt;</span> <a href="index.html#type-t">t</a></code></dt><dt class="spec value" id="val-widen"><a href="#val-widen" class="anchor"></a><code><span class="keyword">val</span> widen : <span>prev:<a href="index.html#type-t">t</a></span> <span>&#45;&gt;</span> <span>next:<a href="index.html#type-t">t</a></span> <span>&#45;&gt;</span> <span>num_iters:int</span> <span>&#45;&gt;</span> <a href="index.html#type-t">t</a></code></dt></dl></details></div></div></div><dl><dt class="spec value" id="val-initial"><a href="#val-initial" class="anchor"></a><code><span class="keyword">val</span> initial : <a href="index.html#type-t">t</a></code></dt><dd><p>initial domain state</p></dd></dl><dl><dt class="spec value" id="val-acquire"><a href="#val-acquire" class="anchor"></a><code><span class="keyword">val</span> acquire : <span>?&#8288;tenv:<a href="../IR/Tenv/index.html#type-t">IR.Tenv.t</a></span> <span>&#45;&gt;</span> <a href="index.html#type-t">t</a> <span>&#45;&gt;</span> <span>procname:<a href="../IR/Procname/index.html#type-t">IR.Procname.t</a></span> <span>&#45;&gt;</span> <span>loc:<a href="../IBase/Location/index.html#type-t">IBase.Location.t</a></span> <span>&#45;&gt;</span> <span><a href="index.html#module-Lock">Lock</a>.t list</span> <span>&#45;&gt;</span> <a href="index.html#type-t">t</a></code></dt><dd><p>simultaneously acquire a number of locks, no-op if list is empty</p></dd></dl><dl><dt class="spec value" id="val-release"><a href="#val-release" class="anchor"></a><code><span class="keyword">val</span> release : <a href="index.html#type-t">t</a> <span>&#45;&gt;</span> <span><a href="index.html#module-Lock">Lock</a>.t list</span> <span>&#45;&gt;</span> <a href="index.html#type-t">t</a></code></dt><dd><p>simultaneously release a number of locks, no-op if list is empty</p></dd></dl><dl><dt class="spec value" id="val-blocking_call"><a href="#val-blocking_call" class="anchor"></a><code><span class="keyword">val</span> blocking_call : <span>callee:<a href="../IR/Procname/index.html#type-t">IR.Procname.t</a></span> <span>&#45;&gt;</span> <a href="../Concurrency/StarvationModels/index.html#type-severity">Concurrency.StarvationModels.severity</a> <span>&#45;&gt;</span> <span>loc:<a href="../IBase/Location/index.html#type-t">IBase.Location.t</a></span> <span>&#45;&gt;</span> <a href="index.html#type-t">t</a> <span>&#45;&gt;</span> <a href="index.html#type-t">t</a></code></dt><dt class="spec value" id="val-wait_on_monitor"><a href="#val-wait_on_monitor" class="anchor"></a><code><span class="keyword">val</span> wait_on_monitor : <span>loc:<a href="../IBase/Location/index.html#type-t">IBase.Location.t</a></span> <span>&#45;&gt;</span> <a href="../Absint/FormalMap/index.html#type-t">Absint.FormalMap.t</a> <span>&#45;&gt;</span> <span><a href="../Absint/HilExp/index.html#type-t">Absint.HilExp.t</a> list</span> <span>&#45;&gt;</span> <a href="index.html#type-t">t</a> <span>&#45;&gt;</span> <a href="index.html#type-t">t</a></code></dt><dt class="spec value" id="val-future_get"><a href="#val-future_get" class="anchor"></a><code><span class="keyword">val</span> future_get : <span>callee:<a href="../IR/Procname/index.html#type-t">IR.Procname.t</a></span> <span>&#45;&gt;</span> <span>loc:<a href="../IBase/Location/index.html#type-t">IBase.Location.t</a></span> <span>&#45;&gt;</span> <span><a href="../Absint/HilExp/index.html#type-t">Absint.HilExp.t</a> list</span> <span>&#45;&gt;</span> <a href="index.html#type-t">t</a> <span>&#45;&gt;</span> <a href="index.html#type-t">t</a></code></dt><dt class="spec value" id="val-strict_mode_call"><a href="#val-strict_mode_call" class="anchor"></a><code><span class="keyword">val</span> strict_mode_call : <span>callee:<a href="../IR/Procname/index.html#type-t">IR.Procname.t</a></span> <span>&#45;&gt;</span> <span>loc:<a href="../IBase/Location/index.html#type-t">IBase.Location.t</a></span> <span>&#45;&gt;</span> <a href="index.html#type-t">t</a> <span>&#45;&gt;</span> <a href="index.html#type-t">t</a></code></dt><dt class="spec value" id="val-add_guard"><a href="#val-add_guard" class="anchor"></a><code><span class="keyword">val</span> add_guard : <span>acquire_now:bool</span> <span>&#45;&gt;</span> <span>procname:<a href="../IR/Procname/index.html#type-t">IR.Procname.t</a></span> <span>&#45;&gt;</span> <span>loc:<a href="../IBase/Location/index.html#type-t">IBase.Location.t</a></span> <span>&#45;&gt;</span> <a href="../IR/Tenv/index.html#type-t">IR.Tenv.t</a> <span>&#45;&gt;</span> <a href="index.html#type-t">t</a> <span>&#45;&gt;</span> <a href="../Absint/HilExp/index.html#type-t">Absint.HilExp.t</a> <span>&#45;&gt;</span> <a href="index.html#module-Lock">Lock</a>.t <span>&#45;&gt;</span> <a href="index.html#type-t">t</a></code></dt><dd><p>Install a mapping from the guard expression to the lock provided, and optionally lock it.</p></dd></dl><dl><dt class="spec value" id="val-lock_guard"><a href="#val-lock_guard" class="anchor"></a><code><span class="keyword">val</span> lock_guard : <span>procname:<a href="../IR/Procname/index.html#type-t">IR.Procname.t</a></span> <span>&#45;&gt;</span> <span>loc:<a href="../IBase/Location/index.html#type-t">IBase.Location.t</a></span> <span>&#45;&gt;</span> <a href="../IR/Tenv/index.html#type-t">IR.Tenv.t</a> <span>&#45;&gt;</span> <a href="index.html#type-t">t</a> <span>&#45;&gt;</span> <a href="../Absint/HilExp/index.html#type-t">Absint.HilExp.t</a> <span>&#45;&gt;</span> <a href="index.html#type-t">t</a></code></dt><dd><p>Acquire the lock the guard was constructed with.</p></dd></dl><dl><dt class="spec value" id="val-remove_guard"><a href="#val-remove_guard" class="anchor"></a><code><span class="keyword">val</span> remove_guard : <a href="index.html#type-t">t</a> <span>&#45;&gt;</span> <a href="../Absint/HilExp/index.html#type-t">Absint.HilExp.t</a> <span>&#45;&gt;</span> <a href="index.html#type-t">t</a></code></dt><dd><p>Destroy the guard and release its lock.</p></dd></dl><dl><dt class="spec value" id="val-unlock_guard"><a href="#val-unlock_guard" class="anchor"></a><code><span class="keyword">val</span> unlock_guard : <a href="index.html#type-t">t</a> <span>&#45;&gt;</span> <a href="../Absint/HilExp/index.html#type-t">Absint.HilExp.t</a> <span>&#45;&gt;</span> <a href="index.html#type-t">t</a></code></dt><dd><p>Release the lock the guard was constructed with.</p></dd></dl><dl><dt class="spec value" id="val-schedule_work"><a href="#val-schedule_work" class="anchor"></a><code><span class="keyword">val</span> schedule_work : <a href="../IBase/Location/index.html#type-t">IBase.Location.t</a> <span>&#45;&gt;</span> <a href="../Concurrency/StarvationModels/index.html#type-scheduler_thread_constraint">Concurrency.StarvationModels.scheduler_thread_constraint</a> <span>&#45;&gt;</span> <a href="index.html#type-t">t</a> <span>&#45;&gt;</span> <a href="../IR/Procname/index.html#type-t">IR.Procname.t</a> <span>&#45;&gt;</span> <a href="index.html#type-t">t</a></code></dt><dd><p>record the fact that a method is scheduled to run on a certain thread/executor</p></dd></dl><dl><dt class="spec type" id="type-summary"><a href="#type-summary" class="anchor"></a><code><span class="keyword">type</span> summary</code><code> = </code><code>{</code><table class="record"><tr id="type-summary.critical_pairs" class="anchored"><td class="def field"><a href="#type-summary.critical_pairs" class="anchor"></a><code>critical_pairs : <a href="index.html#module-CriticalPairs">CriticalPairs</a>.t;</code></td></tr><tr id="type-summary.thread" class="anchored"><td class="def field"><a href="#type-summary.thread" class="anchor"></a><code>thread : <a href="ThreadDomain/index.html#type-t">ThreadDomain.t</a>;</code></td></tr><tr id="type-summary.scheduled_work" class="anchored"><td class="def field"><a href="#type-summary.scheduled_work" class="anchor"></a><code>scheduled_work : <a href="index.html#module-ScheduledWorkDomain">ScheduledWorkDomain</a>.t;</code></td></tr><tr id="type-summary.attributes" class="anchored"><td class="def field"><a href="#type-summary.attributes" class="anchor"></a><code>attributes : <a href="AttributeDomain/index.html#type-t">AttributeDomain.t</a>;</code></td><td class="doc"><p>final-state attributes that affect instance variables only</p></td></tr><tr id="type-summary.return_attribute" class="anchored"><td class="def field"><a href="#type-summary.return_attribute" class="anchor"></a><code>return_attribute : <a href="Attribute/index.html#type-t">Attribute.t</a>;</code></td></tr></table><code>}</code></dt></dl><dl><dt class="spec value" id="val-empty_summary"><a href="#val-empty_summary" class="anchor"></a><code><span class="keyword">val</span> empty_summary : <a href="index.html#type-summary">summary</a></code></dt><dt class="spec value" id="val-pp_summary"><a href="#val-pp_summary" class="anchor"></a><code><span class="keyword">val</span> pp_summary : <a href="index.html#module-F">F</a>.formatter <span>&#45;&gt;</span> <a href="index.html#type-summary">summary</a> <span>&#45;&gt;</span> unit</code></dt><dt class="spec value" id="val-integrate_summary"><a href="#val-integrate_summary" class="anchor"></a><code><span class="keyword">val</span> integrate_summary : <span>?&#8288;tenv:<a href="../IR/Tenv/index.html#type-t">IR.Tenv.t</a></span> <span>&#45;&gt;</span> <span>?&#8288;lhs:<a href="../Absint/HilExp/AccessExpression/index.html#type-t">Absint.HilExp.AccessExpression.t</a></span> <span>&#45;&gt;</span> <span>?&#8288;subst:<a href="Lock/index.html#type-subst">Lock.subst</a></span> <span>&#45;&gt;</span> <a href="../Absint/CallSite/index.html#type-t">Absint.CallSite.t</a> <span>&#45;&gt;</span> <a href="index.html#type-t">t</a> <span>&#45;&gt;</span> <a href="index.html#type-summary">summary</a> <span>&#45;&gt;</span> <a href="index.html#type-t">t</a></code></dt><dd><p>apply a callee summary to the current abstract state; <code>lhs</code> is the expression assigned the returned value, if any</p></dd></dl><dl><dt class="spec value" id="val-summary_of_astate"><a href="#val-summary_of_astate" class="anchor"></a><code><span class="keyword">val</span> summary_of_astate : <a href="../IR/Procdesc/index.html#type-t">IR.Procdesc.t</a> <span>&#45;&gt;</span> <a href="index.html#type-t">t</a> <span>&#45;&gt;</span> <a href="index.html#type-summary">summary</a></code></dt><dt class="spec value" id="val-filter_blocking_calls"><a href="#val-filter_blocking_calls" class="anchor"></a><code><span class="keyword">val</span> filter_blocking_calls : <a href="index.html#type-t">t</a> <span>&#45;&gt;</span> <a href="index.html#type-t">t</a></code></dt><dt class="spec value" id="val-remove_dead_vars"><a href="#val-remove_dead_vars" class="anchor"></a><code><span class="keyword">val</span> remove_dead_vars : <a href="index.html#type-t">t</a> <span>&#45;&gt;</span> <span><a href="../IR/Var/index.html#type-t">IR.Var.t</a> list</span> <span>&#45;&gt;</span> <a href="index.html#type-t">t</a></code></dt></dl></div></body></html>