Home / Docs / Specification / 27. Tasks and time
27.11 The timing label of concurrent work
Normative for τ_conc of a within (§5 rule 8), of a first of (§6 rule 8), of a for ever within (spec/26 §7 rule 5), of the tick of a driven step (conc(step), spec/26 §2 rule 5), of the constructs that L_res counts (spec/26 §7 rule 5, item 6) and of the requests that L_lim counts (§9 rule 5), as ADR 0116 states it in its amendment of 2026-10-25 (P0 to P5). The other timing sites, the statement a limiter scopes over (§10) and L_srv (spec/31 §1), keep the preview's τ_conc until this section names them: ⊤ for a site inside a lambda, a task, the block of a tasks statement or a handler's operation, in a function that a part of a task construct can reach, or, in a package with a task construct, in a function that a function value, a lambda or a handler's operation can run, whether or not a part reaches it; public otherwise.
-
The whole program (P0). The analysis sees every function whose code can run in the process: the package, the standard library and the prelude. A function with neither a body nor a summary is a node whose
τ⁰andconcare⊤. -
The graph (P1). It has a node per function, those of the prelude without a body included; one node
Λfor every lambda of the package; one node per handler, for all of its operations; and one nodeK(c)per capabilityc. Each edge records its call site and the innermost construct of that site (rule 4):- a call of a function, or a use of its name as a value, goes from the node whose code holds it to that function; a policy call goes to its
viafunction as well (spec/07 §5); - a call of a function value, or of a
uses ofparameter, goes toΛ; a prelude function with a parameter of function type has an edge toΛ, andΛhas an edge to every function named as a value; - an operation goes to
K(c), through the operation, andK(c)has an edge to each handler ofc; a function has an edge to the operations of itsuses, which covers a prelude function without a body; an installation goes to its handler; - a call inside a lambda's body leaves from
Λ, and one inside a handler's operation from the handler. Code outside every node, such as an example'sdoline, records its edges too, which raise what they reach (rule 4).
Every call counts, whether or not an entry reaches it.
- a call of a function, or a use of its name as a value, goes from the node whose code holds it to that function; a policy call goes to its
-
Parts and
κ(P2).κhere is the labelctxandconccarry; a race's owntcounts its branches as §6 rule 8 states. The parts of a task constructCare each branch oftogetherand offirst of, the body oftogether for, and the block oftaskswith eachstartin it. The list oftogether forand the bound oftasksare not parts.κ(C)isτ⁰of the whole construct, its list and its bound included: the items of spec/26 §7 rule 5 other than 5 and 6, over the call graph of rule 2, where a part that calls a function value or a prelude function with a function argument has⊤. A site in a part countsκ(C), the part that holds it included: its own code before the site decides which work of its siblings the site overlaps. -
Through calls (P3). The constructs of one node's code form a tree by nesting; a lambda's body starts a tree of its own.
ctxof a construct isctxof its parent joined with itsκ, andctx(s)of a site or an edge is that of its innermost construct, or nothing outside every one.conc(n)of a node is the least label such thatconc(n) ≥ conc(m) ⊔ ctx(s)for every edge fromm, at the sites, ton, andconc(n) ≥ ctx(s)for every edge from code outside every node (rule 2); the members of a cycle of calls share oneconc. -
At a site (P4). For a site
ein the code of the noden,τ_conc(e) = conc(n) ⊔ ctx(e). A site in no node of the graph, such as one in an example'sdoline, hasτ_conc = ⊤. -
What it means (P5).
κ(C)rises above a labellonly when the work of some part ofCcan depend on data abovel, whatever the number of tasks. A construct whose parts handle onlypublicandinternaldata gives at mostinternal, and a program without task constructs hasτ_conc = publiceverywhere. So does a site in a lambda or in a handler's operation that no part of a construct reaches, since nothing runs beside it. -
Fail closed. A construct whose seed was not recorded, and a construct id that names no construct, count as
⊤. -
Costs (amendment, E). The graph,
κof every construct,ctxandconcare computed once per package, in O(V + E + F) joins over theVnodes,Eedges andFconstructs, plusκ's reading of each construct's recorded seed; a cycle is one strongly connected component.τ_concof a site is then O(1) joins.