Skip to content
0:00 / 0:00

#structuredconcurrency#kotlincoroutines

Roman Elizarov — Structured concurrency

Hydra

3.2K subscribers • 2 videos on Hallway

YouTube
  • Recommended by 1 person: 1 in engineering communities.
  • Presented by Roman Elizarov, Kotlin Project Lead

Advanced. Deep dive for people who know the field.

28K views7 years ago1 recommendation

Programming languagesSystems programmingKotlinConcurrency and parallelismDesign patterns

Roman Elizarov explains the design history and principles behind structured concurrency in the Kotlin programming language.

About Hydra conference: jrg.su/6Cf8RP — Hydra 2022 — June 2-3 Info and tickets: bit.ly/3ni5Hem — — A traditional approach to concurrency in programming languages is well known — you are given primitives that launch concurrent processes, threads, tasks, coroutines, actors (you name it!) and some means to establish communication between them. As systems become more concurrent and as those primitives become more lightweight, tracking lifetimes of those entities and making sure they do not leak becomes a challenge. In this talk we'll tell the story of the path that we went through when designing concurrency libraries for Kotlin programming language. How we started with traditional concurrency primitives and how we've discovered and implemented the concept of structured concurrency, what's behind the name, and how it is now gaining popularity in other ecosystems. It would not be an exaggeration to say that we are witnessing a programming style revolution akin to move from GOTO-based unstructured code of the past to the structured programming paradigms of today that had started with iconic "Go To Statement Considered Harmful" letter of Dijkstra in 1968.

Why it's here

1 person recommends this

What people say. Recommended as an excellent explanation of the design history and rationale behind structured concurrency in Kotlin.

u/cris_nullin r/Kotlin • Recommends

This video explains the design history behind structured concurrency in Kotlin. For me, the "How it came to be this way" is a great supplement to the "How you should do this" when it comes to learning

u/yatsokostyain r/Kotlin • Mentions

On “Looking for a specific Kotlin talk”

Maybe one about structured concurrency? [video

u/fractalpixelin r/Kotlin • Mentions

On “I don't understand Coroutines at all”

For some background on structured concurrency that the Kotlin team started applying to the co-routine library at some point, see Notes on structured concurrency, or: Go statement considered harmful. Basically, it concludes that traditional concurrency, where new threads can be spawned from any function, is akin to the old goto keyword that allowed execution to jump to any place in the code - near impossible to debug and reason about. Instead the author suggests languages should implement structured concurrency primitives, basically always joining the forked threads before continuing execution of the code that forked them (I'm still trying to wrap my head around this paradigm, so I'm not s…