Rule 186p-proc-spawn
Transitions
(186)
Comments
The new process names a process never started before, and its origin is : its outcome goes to no other process, and it gives no message (rule (189)).
TeX source
\defnrule[r:p-proc-spawn]
{P(\pid)=(\tk,s',\pgorig)\premsep\tk\effred{\effa}\tk'\premsep
\effa=\effdone{\effspawn(\tk_0)}{\effsucceed\,\pid'}\\
\pid'\notin\Dom P\premsep
P'=P+\{\pid\mapsto(\tk',s,\pgorig),\ \pid'\mapsto(\tk_0,s,\pgspawned)\}}
{(s,v,M,P,\sbv,Q,H)\step{\effa}(s,v,M,P',\sbv,Q,H)}Tests (7)
- elm / MinimalSpawnTestA spawned process runs, and ends when its task succeeds.
- elm-core / CoreIssue955KillProcessTwiceTestKilling a process that has already finished, a second time, throws a JavaScript error.
- elm-core / ProcessPrimitiveOutcomeTestThe primitive tasks `Process.sleep`, `Process.spawn` and `Process.kill` succeed with their outcomes.
- elm-core / ProcessSpawnKillHalfTestA process killed with `Process.kill` before its sleep finishes never runs the rest of its task, while the processes left alive do.
- elm-core / ProcessSpawnRecursiveTestA process spawned with `Process.spawn` can itself spawn a process, nested five deep, and every level runs.
- elm-core / ProcessSpawnedFailureEndsTestA spawned process whose task fails ends quietly, and the program goes on.
- elm-core / ProcessYieldThrashingTestTwo processes that each repeatedly yield with `Process.sleep 0` both run to completion.
Discussions
Discuss this rule·Search the discussions on GitHub
Discussions are on GitHub; one about this rule has [r:p-proc-spawn] in its title.
A Standard Definition of Elm? (Draft version 0.4) © Rupert Smith. The text is licensed under CC BY 4.0: share and adapt it freely, with credit and a link to the licence.