Structured concurrency: Difference between revisions

Content deleted Content added
Line 9:
The [[fork–join model]] from the 1960s, embodied by multiprocessing tools like [[OpenMP]], is an early example of a system ensuring all threads have completed before exit. However, Smith argues that this model is not true structured concurrency as the programming language is unaware of the joining behavior, and is thus unable to enforce safety.<ref name=smith/>
 
The concept was formulated in 2016 by Martin Sústrik (creator of [[ZeroMQ]]) with his C library libdill, with [[Go_(programming_language)#Concurrency:_goroutines_and_channels|goroutines]] as a starting point.<ref>{{cite web |last1=Sústrik |first1=Martin |title=Structured Concurrency |url=http://250bpm.com/blog:71 |date=7 February 2016 |accessdate=1 August 2019}}</ref> It was further refined in 2018 by Nathaniel J. Smith, who implementedintroduced ita "nursery pattern" in ahis [[Python library(programming language)|Python]] implementation called Trio.<ref name=smith>{{cite web |last1=Smith |first1=Nathaniel J. |title=Notes on structured concurrency, or: Go statement considered harmful |url=https://vorpus.org/blog/notes-on-structured-concurrency-or-go-statement-considered-harmful/ |date=25 April 2018 |accessdate=1 August 2019}}</ref> Meanwhile, Roman Elizarov independently came upon the same ideas while developing an experimental coroutine library for the [[Kotlin (programming language)|Kotlin language]].<ref>{{cite web |last1=Elizarov |first1=Roman |title=Structured concurrency |url=https://medium.com/@elizarov/structured-concurrency-722d765aa952 |date=12 September 2018 |accessdate=21 September 2019}}</ref><ref>{{cite AV media |people=Elizarov, Roman |date=July 2019 |title=Structured concurrency |medium=Videotape |language=en |url=https://youtube.com/watch?v=Mj5P47F6nJg&t=2538 |access-date=21 September 2019 |publisher=Hydra Distributed computing conference |minutes=42 |quote="We needed a name and we needed to finalize this whole concept [...] and we stumble onto this blog post [...] by Nathaniel J. Smith."}}</ref>
 
In 2019, the loom project from [[OpenJDK]] is adopting structured concurrency to bring it to the [[Java platform]] in a future release as part of a larger work on [[lightweight thread]]s and [[coroutine]]s.<ref>{{cite web |last1=Bateman |first1=Alan |website=openjdk.java.net |publisher=[[OpenJDK]] |access-date=November 23, 2019 |title=Structured concurrency |url=https://wiki.openjdk.java.net/display/loom/Structured+Concurrency}}</ref>