Flipping Concurrency

Dominic Robinson

⏱ 90 minute session
advanced
16:00-17:30, Thursday, 3rd April 2025
Current approaches to concurrency are mired in their control flow centric approach. Incidental complexity abounds. With apologies to Turing and von Neumann, sometimes we must stand on the shoulders of giants to climb out of the pit we find ourselves in. First class continuations are a powerful abstraction for building arbitrary control structures, but their counterintuitive nature and complexity makes them hard to employ. A change of perspective is required. By applying an inversion of control to continuations we can create a new form of composable behaviours that can tame the demons of callback hell and escape the imperative traps that await the unwary. With parallels in the event schemas of cognitive psychology’s event segmentation theory, this contextual model of programming provides a natural, declarative way of composing concurrent programs. A novel approach to handlers unifies sunny days, exceptional flows, and dependency injection in a single overarching mechanism.

All this can be implemented with off-the-shelf C++20 with strong typing, reflection, ergonomic diagnostics, and perfect code navigation from clangd.

Fighting talk? Come along and find out…

Not suitable for all applications, may contain novel ideas, strong opinions, and nuts. Allergens: macros and templates.

🏷 concurrency
🏷 continuations
🏷 domain specific language

Dominic Robinson

Dominic has spent the best part of 40 years developing software in various assembly languages, C and C++. The last 20 of these have been at SN Systems Ltd, Sony Interactive Entertainment where he leads the team that develops a distributed build accelerator. He has been cursed with a quest for better ways to write concurrent and distributed software in C++.