Structured concurrency resources (original) (raw)
February 5, 2019, 7:36am 1
This is a wiki post (anyone can edit) to collect links to articles and other resources about structured concurrency. It’s probably missing stuff – please add to it!
Implementations
- C: libdill
- Python: Trio, anyio
- Kotlin: Coroutines
- Swift: Venice (based on libdill)
Articles, talks, etc.
Ordered roughly by date:
2016
- Structured concurrency – Martin Sústrik (Note: first known use of the term)
2018
- Timeouts and cancellation for humans – Nathaniel J. Smith
- Notes on structured concurrency, or: Go statement considered harmful – Nathaniel J. Smith (translations: Russian)
- Structured concurrency in high-level languages – Martin Sústrik (note: introduces the concept of “call tree” as opposed to “call stack”)
- Trio: Async concurrency for mere mortals (code and slides; Russian translation) – Nathaniel J. Smith (Note: Talk at PyCon 2018. Contains an overview of how Trio works and why you’d want to use it, for an audience that may or may not know anything about concurrency. Also, the infamous Happy Eyeballs example.)
- Structured concurrency – Roman Elizarov (Note: announces Kotlin’s shift to structured concurrency)
- “Concurrency made easy”: coming soon to a programming language near you – John Belmonte (Note: async/await + structured concurrency + explicit context switch == bliss)
- Update on structured concurrency – Martin Sústrik (note: interesting discussion between different system designers in the comments)
- Two approaches to structured concurrency – Martin Sústrik (note: compares two ways of implementing Happy Eyeballs, in libdill and Trio)
2019
- Short talk at FOSDEM 2019: Structured concurrency – Martin Sústrik
- Graceful Shutdown – Martin Sústrik
- Structured Concurrency - Roman Elizarov, talk at Hydra distributed computing conference (Note: gives background on how Kotlin’s coroutine library arrived at structured concurrency)
- Inside a companion robot: Productive concurrency with Trio - John Belmonte, talk at PyCon JP (Note: highlights how concurrent programming is becoming accessible to non-specialists)
- Structured Concurrency Asynchronous shift in Kotlin - Manuel Vicente Vivo, talk at Codemotion Madrid 2019
2022
- Structured Concurrency - Sebastiaan Koppe, DConf '22 (Note: good overview, considers the existing C++ P2300 concurrency proposal, including how “structured” it is, as well as how it supports “sans-I/O”, and rendering something similar in D language.)
elizarov February 10, 2019, 8:17am 3
The following link can be used for Kotlin coroutines: http://kotlinlang.org/docs/reference/coroutines/basics.html This is the basic intro into the coroutines library and it contains a separate section on structured concurrency.
njs February 10, 2019, 8:19am 4
Hello and thanks! Do you want to edit the original post to add that? I think you should be able to by clicking the “Edit” button at the bottom of it, and I’m kind of curious whether it works :-). (If it doesn’t then I can edit it in.)
elizarov February 10, 2019, 8:25am 5
It does not show “Edit” for me. By the way, my recent post on “The reason to avoid GlobalScope” https://medium.com/@elizarov/the-reason-to-avoid-globalscope-835337445abc is also a veiled ad for structured concurrency, showing typical problems that exist if you don’t have one.
njs February 10, 2019, 8:30am 6
Ah-hah, apparently there’s an anti-spam thing where users have to be “trust level 1” before they can edit wiki posts, and since you only signed up 10 minutes ago you were still “trust level 0”. I just manually marked you as “trust level 2”, so you should be able to edit it now (and also post unlimited links and stuff like that).
sustrik February 10, 2019, 8:32am 7
Roman also has several posts on Medium which could fit in. I’m also going to add my own piece that introduces the idea of call stack vs. call tree.
njs February 10, 2019, 9:26am 8
@sustrik Your link was already there I merged the duplicates.
PS: check it out: “tree-o”
(full disclosure: this wasn’t actually the original motivation for the name… I was explaining the ideas to Stefan Karpinski and when I got to call trees he was like “oh, that’s why you called it that!” and I was like “wait what? oh, I mean… yes, exactly, because I’m very clever”)
kdart January 11, 2020, 12:52am 9
I can’t edit this. So I’ll just suggest a change. I think you should add curio
to the list of Python packages that support this.
njs January 14, 2020, 9:38am 10
Hmm, so that raises an interesting question… there are a lot of systems like Curio that make it possible to arrange concurrency in a structured way (curio taskgroups, erlang supervisors, go errgoup, rust crossbeam::scope
, etc etc), but currently the list only shows packages where “structured concurrency” is an organizing principle for the whole API. Is a more comprehensive list useful? Does someone want to take responsibility for curating it?
I just published an nursery for Rust:
I hope it’s ok I re-used the name nursery. All feedback welcome.
cli345 June 13, 2023, 4:57pm 12
Here is a list of what I feel to be (at least partial) “structured concurrency” solutions.
Brian-M-J February 27, 2024, 6:07am 13
Another entry for 2022:
Structured Concurrency - A talk at ACCU 2022 by Lucian Radu Teodorescu
The code for senders and receivers is currently at NVIDIA’s stdexec repository (I can only put a maximum of 2 links in the post). There’s also a bunch more links there if you want to dig deeper.
Hylo-lang (formerly Val) also has these (mentioned here). What’s notable is the lack of function colouring.