Jump to content

Structured concurrency

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by AnomieBOT (talk | contribs) at 04:53, 21 September 2019 (Dating maintenance tags: {{Citation needed}}). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

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 programming. The core concept is that when control splits into concurrent tasks that they join up again, 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 scheduled to be executed in fibers then those fibers 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, threads, fibers).

The concept was formulated and named "structured concurrency" in 2016 by Martin Sústrik (creator of ZeroMQ)[1]. Without knowledge of Sústrik's work[citation needed], the concept was independently offered in April 2018 by Nathaniel J. Smith, who implemented it in the Trio library for Python[2], and in September 2018 by Roman Elizarov, while developing an experimental coroutine library for the Kotlin language[3]. (Smith happened to give the same name to concept, while Elizarov adopted the name after reading Smith's article, shortly before publishing his own work for Kotlin[4].)

See also

References

Citations

  1. ^ Sústrik, Martin (7 February 2016). "Structured Concurrency". Retrieved 1 August 2019.
  2. ^ Smith, Nathaniel J. (25 April 2018). "Notes on structured concurrency, or: Go statement considered harmful". Retrieved 1 August 2019.
  3. ^ Elizarov, Roman (12 September 2018). "Structured concurrency". Retrieved 21 September 2019.
  4. ^ Elizarov, Roman (July 2019). Structured concurrency (Videotape). Hydra Distributed computing conference. 42 minutes in minutes in. Retrieved 21 September 2019. [...] we needed a name and we needed to finalize this whole concept [...] and [Nathaniel J. Smith] got a really good name for it, he called it structured concurrency.