TGViewer
C++ - Reddit C++ - Reddit @r_cpp · 229 subscribers
Post #24595 30
executor affinity for ALL awaitables

I've been working on robust C++20 coroutine support in beast2 and I ran up against the "executor affinity" problem: making sure that tasks resume in the right context when they await another coroutine that might switch the context. I found there is some prior art (P3552R3) yet I am deeply unsatisfied to see it only works with senders. I came up with a general solution but I am a coroutine noob and it is hard to imagine that I can possibly be correct. I would like to know if there is a defect in my paper.

Simplifying P3552R3 with make_affine

This paper proposes make\_affine as a new reusable component for P3552R3, complementing the existing as\_awaitable and with\_awaitable\_senders building blocks. Unlike the sender-constrained affine\_on algorithm, make\_affine provides scheduler affinity for any awaitable, not just senders. This extends P3552R3's design philosophy of reusable components to cover the entire awaitable ecosystem.

https://github.com/vinniefalco/make\_affine/blob/master/p-make-affine.md

Yes I know that P3552R3 is already accepted yet I'd still like to know if I have a defect. Working code is also in the repo:

https://github.com/vinniefalco/make\_affine

Thanks


https://redd.it/1pzmei3
@r_cpp
More from @r_cpp
  1. Oct 9, 2026std::variant, operator== and pattern matching I was thinking, wouldn't adding equality com…
  2. Oct 8, 2026Profiles for simplicity and guarantees - Bjarne Stroustrup - CppCon 2026 https://youtu.be/…
  3. Oct 8, 2026How to Fix autoconf-style Configuration Probing https://build2.org/blog/fix-autoconf.xhtml…
  4. Oct 8, 2026owl – a header-only C++23 HTTP framework where route patterns and handler extractors are c…
  5. Oct 8, 2026Removed by Reddit Removed by Reddit on account of violating the [content policy. ] https:/…
  6. Oct 8, 2026Is there a way to search across all P and N papers throughout standardization history? It…
Threads Profile ViewerView any public Threads profile without an account.Open ThreadLook →Writing with AI? Make it sound human.Metric37 rewrites AI drafts so they read naturally. Free AI detector, 1,500 words free.Try Metric37 →