Content deleted Content added
m define without "scheduling fibers" |
cancellation handling is fundamental to structured concurrency (errors should always propagate up to the parent) |
||
Line 1:
{{Programming paradigms}}
'''Structured concurrency''' is a [[programming paradigm]] aimed at improving the clarity, quality, and development time of a [[computer program]] by using a structured approach to [[concurrent computing|concurrent programming]]. The core concept is that when control splits into concurrent tasks that they join up again, that subtask errors cause children and siblings to be cancelled before propagating to the parent, and that this control flow is readily evident by the structure of the source code. If a "main task" splits into several concurrent sub-tasks then those sub-tasks must terminate before the main task can complete. To be effective, this model must be applied consistently throughout the program-- otherwise concurrent tasks may leak out, become orphaned, or fail to have runtime errors correctly propagated.
The naming is inspired by [[structured programming]], which created higher level control-flow statements out of the very basic [[goto]]. Similarly, structured concurrency creates higher level mechanisms for concurrency constructs out of the basic concurrent task creation constructs ([[Spawn (computing)|spawn]], [[Thread (computing)|thread]]s, [[Fiber (computer science)|fiber]]s).
|