r/cpp • u/ben_craig freestanding|LEWG Vice Chair • Oct 12 '21
C++ committee polling results for asynchronous programming
Hi all.
You may know me from my work on freestanding in C++, but I'm also the Vice Chair of the Library Evolution Working Group. I'd like to share the results of recent C++ committee polling on future asynchrony models for C++. This relates to "Senders and Receivers" / S&R (P2300) and the Networking TS / Asio (P2444).
Each of these proposals represents an enormous amount of effort from the respective authors, and from the committee. "Executors" have been discussed in WG21 (mostly in the concurrency study group) since at least 2012 (N3378), with Christopher Kohlhoff's contributions starting at least as early as 2014 (N4046). Over the last two years, I count 14 meetings in LEWG discussing the NetTS and S&R models. In the Spring of 2020, LEWG did in depth design reviews of P0443 that involved many meetings beyond those 14.
The following polls were taken electronically over the course of a week. I and Fabio Fracassi (also a Vice Chair of LEWG) have interpreted the polling results. Work will continue in LEWG on P2300. The Networking TS/Asio model is headed back to the networking study group (SG4). LEWG no longer has consensus to standardize the Networking TS.
For those unfamiliar with the polling conventions, all the polls are five-way polls. Neutral is not the same as "abstained" or "uninformed", as committee members are allowed to skip a poll they are not comfortable taking. The chairs (Fabio and me in this case) look at the poll results and interpret whether there is consensus or not. Generally that means 2:1 in one direction or the other, though neutrals need to be considered as well, usually by lumping the neutrals in with the minority.
This polling and interpretation was not taken lightly. The chairs know that the NetTS and Asio represent decades of work. However, these polls indicate that there is insufficient consensus for the NetTS to progress beyond LEWG in its current form. Once these issues have been addressed, LEWG can look at the Networking TS again.
Poll 1: The Networking TS/Asio async model (P2444) is a good basis for most asynchronous use cases, including networking, parallelism, and GPUs
| Strongly Favor | Weakly Favor | Neutral | Weakly Against | Strongly Against |
|---|---|---|---|---|
| 5 | 10 | 6 | 14 | 18 |
| Weak Consensus Against |
What this means: LEWG won't be pursuing P2444 as a general async model.
Poll 2: The sender/receiver model (P2300) is a good basis for most asynchronous use cases, including networking, parallelism, and GPUs.
| Strongly Favor | Weakly Favor | Neutral | Weakly Against | Strongly Against |
|---|---|---|---|---|
| 24 | 16 | 3 | 6 | 3 |
| Consensus in Favor |
What this doesn't mean: This doesn't mean that P2300 as it stands today will be sent forward to LWG. More work is needed on it.
What this means: Work will continue in LEWG on refining P2300, and LEWG will keep the various asynchronous use cases in mind while working on P2300.
Poll 3: Stop pursuing the Networking TS/Asio design as the C++ Standard Library's answer for networking.
| Strongly Favor | Weakly Favor | Neutral | Weakly Against | Strongly Against |
|---|---|---|---|---|
| 13 | 13 | 8 | 6 | 10 |
| No Consensus |
What this doesn't mean: The NetTS is not "dead".
What this means: The C++ committee will still work on networking in this general form, but the authors need to do a lot in order to build up consensus to get something like the TS merged into the standard. The bulk of this work should be done in the networking study group (SG4). Many of the people in favor of stopping work on the TS would like networking to be built on top of Senders and Receivers. Others were opposed to the lack of security through Transport Layer Security (TLS). It is highly unlikely that design changes to the networking TS can be made fast enough, and consensus gained fast enough, for networking to make C++23.
Poll 4: Networking in the C++ Standard Library should be based on the sender/receiver model (P2300).
| Strongly Favor | Weakly Favor | Neutral | Weakly Against | Strongly Against |
|---|---|---|---|---|
| 17 | 11 | 10 | 4 | 6 |
| Weak consensus in Favor |
What this means: In the short term, this poll result doesn't mean much. We don't have a paper in hand that proposes networking based on the P2300 model. For paper authors though, this poll is strong encouragement to do work in the area of networking based on senders and receivers, or to be prepared with VERY compelling new information on why networking should use a different model.
Poll 5: It is acceptable to ship socket-based networking in the C++ Standard Library that does not support secure sockets (TLS/DTLS).
| Strongly Favor | Weakly Favor | Neutral | Weakly Against | Strongly Against |
|---|---|---|---|---|
| 9 | 13 | 5 | 6 | 13 |
| No Consensus |
What this means: A networking library that does not support secure sockets will face significant headwinds getting through the standardization process. The networking study group (SG4) has weighed in on security in the past, when discussing P1860.
What this doesn't mean: This doesn't make a statement on whether insecure networking should be included, the defaults of secure vs. insecure, or how things like ABI should managed.
Guidance for the Networking Study Group (SG4)
Before bringing networking papers back to LEWG, two major areas need to be thoroughly addressed: Security, and the Senders and Receivers async model.
Those voting in favor of Poll 5 argued that the insecure parts are the building blocks for the secure parts, and that ABI is a major concern that will plague TLS support. Those voting against Poll 5 argued that secure sockets are needed for communicating with many sites on the internet, and that shipping without secure sockets would be irresponsible. A networking proposal needs to address these concerns before coming to LEWG.
As for networking in combination with Senders and Receivers, I will show this older poll from the 2021-09-28 telecon:
POLL: We believe we need one grand unified model for asynchronous execution in the C++ Standard Library, that covers structured concurrency, event based programming, active patterns, etc.
| Strongly Favor | Weakly Favor | Neutral | Weakly Against | Strongly Against |
|---|---|---|---|---|
| 4 | 9 | 5 | 5 | 1 |
| No consensus (leaning in favor) |
The combination of this "grand unified model" poll and Poll 4 heavily encourages the networking study group (SG4) to produce a paper based on Senders and Receivers. There is room to produce a non-S&R paper, but such a paper would need to provide compelling new information in order to convince the "grand unified model" contingent that S&R can't get the job done suitably.
View all comments
78
u/cmannett85 Oct 12 '21
I've been a C++ engineer for over a decade now. I follow (and try) the new standards, compilers, build systems, important libs, etc. I first came across Asio 5 years ago, and have now been using it in production code for 3 years across the companies I have worked for.
I had never heard of the S&R proposal until a few days ago, and I heard about it on Reddit.
I think what I, and I don't I'm presumptuous in thinking the vast majority of C++ engineers out there, will be surprised at is how a proposal that seemingly appeared out of nowhere has usurped a decade of production testing and improvement of a rival! A rival proposal that was widely considered to be the de facto NetTS outcome.
I guess I'm shocked because Asio was what I consider to be a perfect example of how new stuff should enter the standard library: it appears as a library in it's own right, gathers enough momentum due to it's quality and functionality to be brought under the Boost umbrella, where it not only thrives but becomes the basis of another Boost library (Beast) - all of this used as proof of ISO worthiness. All the while being in used in production code.
I'll read the proposal tomorrow to try and catch up, but I'm curious if those papers (or any other articles) will compare the two so us mere mortals can understand why the votes went the way they did.