{"id":"language--wait-stop-parallel","name":"Wait, stop, and parallel","owner":"yeho","package":"language","kind":"language","signature":"wait 100ms\nwait 1s\nwait nextFrame\nwait 2 frames\nwait taskName\nwait until condition\nstop taskName\nparallel { ... }","description":"wait can pause for a duration, frame, task, or condition. stop requests cancellation, and parallel scopes concurrent branches.","context":"Use the narrowest wait that explains progress. Treat stop as a lifecycle request, not proof that cleanup already finished.","parameters":[],"returns":"","members":[],"tags":["concurrency","cpu","frames","language","nextFrame","parallel","stop","until","wait","yeho"],"updated":"2026-09-09","source":{"repository":"yeho","path":"parser_statements.cpp parseWaitStatement; errors-tasks-effects fixtures"},"status":"experimental","notes":["Supported duration units are target-validated.","parallel failure and cleanup semantics are covered by dedicated fixtures, but the feature is experimental."],"examples":[{"id":"complete","title":"Complete program","description":"Coordinate CPU tasks explicitly. Cancellation is a request; a short task may finish first.","code":"// task is the supported CPU concurrency unit; thread syntax is unavailable.\nCount() -> int { return 42 }\ntask of int worker = task Count()\nstop worker\nwait until worker.finished\nConsole.Log(Text.From(worker.cancelled))\nparallel\n{\n    Console.Log(\"Preparing textures\")\n    Console.Log(\"Preparing audio\")\n}\n","tags":["cpu","language"],"run":"cpu-oracle","expected":null,"verifyRun":false,"manifest":"manifestVersion = \"2\"\npackage = \"api.example.language__wait_stop_parallel\"\nversion = \"0.1.0\"\nlanguageEdition = \"yeho-core-2026.1\"\n\n[app]\nkind = \"headless\"\n","verification":"type checked","sha256":"770ed916dcb09b0f4f7a22b9ce71b6127ec3cb097696c8a742c392b90eeffeee","checked":"2026-09-09","diagnostic":"","observedOutput":null,"checkedBackend":null}],"searchTerms":[],"url":"https://demonhunterlabs.com/academy/api?item=language--wait-stop-parallel","json":"https://demonhunterlabs.com/reference/items/language--wait-stop-parallel.json","markdown":"https://demonhunterlabs.com/reference/text/language--wait-stop-parallel.md"}
