Skip to content

Instantly share code, notes, and snippets.

View ericniebler's full-sized avatar

Eric Niebler ericniebler

View GitHub Profile
@ericniebler
ericniebler / executor_compromise_the_return.md
Last active September 7, 2018 18:01 — forked from LeeHowes/executor_compromise_the_return.md
A second executor compromise

A lazy simplification of P0443

Summary

This paper seeks to add support for lazy task creation and deferred execution to P0443, while also simplifying the fundamental concepts involved in asynchronous execution. It seeks to do this as a minimal set of diffs to P0443. It achieves this by replacing P0443's six Executor::*execute() member functions with two lazy task constructors that each return a lazy Future-like type known as a "Sender". Work is actually enqueued by calling submit() on a Sender.

Background

P0443 presents a unified abstraction for agents of asynchronous execution. It is the result of a long collaboration between experts from many subdomains of concurrent and parallel execution, and achieved consensus within SG1 and, to some degree, LEWG. Although there were known gaps in the abstraction, there were papers in flight to address them, and for all intents and purposes P0443 seemed on-target for a TS or, possibly even C++20.