Coroutines and C++ DSLs for Human Scale Concurrency

By Dominic Robinson

C++ coroutines have not yet been standardised, but are available today in Visual Studio 2015 (coming soon to clang/llvm) in the form of the stackless coroutines/resumable functions [1] presented at CppCon2016 [2][3][4].

This session will look beyond the canonical examples of generators and asynchronous IO to see if coroutines can be leveraged in the pursuit of C++ DSLs to make concurrency easier to work with for humans - "Concurrency at Human Scale".

As of writing, the investigations and technology behind this talk are still evolving, so the outcome is not a foregone conclusion.

Other material, illustrating the search for inspiration on how to tackle these problems, may include:

A look at other systems for specifying, testing and reasoning about concurrency such as Leslie Lamport’s PlusCal/TLA+ [5] (see also [6]).

A look at the facilities for high level control flow manipulation afforded by other languages and runtime systems such as Racket’s first class continuations, continuation marks and prompts [7][8].

A look at other programming models for concurrency including Erlang’s actors (in the form of C++ Erlesque Actors [9]), Linda’s tuple spaces [10], and Syndicate’s coordinated concurrent proramming [11].

Level: Intermediate to expert


[1] Gor Nishanov, Jim Radigan : Resumable Functions - N4402

[2] CppCon 2016: Jame McNellis - Introduction to C++ Coroutines

[3] CppCon 2016: Kenny Kerr & James McNellis “Embracing Standard C++ for the Windows Runtime"

[4] CppCon 2016: Gor Nishanov “C++ Coroutines: Under the covers"

[5] Leslie Lamport: The PlusCal Algorithm Language

[6] ACCU 2016: Dominic Robinson : Test Driven Specification – A Gentle Introduction to TLA+ (finding concurrency bugs before you write code)

[7] Continuations in Racket

[8] Mathew Flatt et al : Adding Delimited and Composable Control to a Production Programming Environment

[10] Nichlas Carriero and David Gelernter : Linda in Context