Skip to content

[2025-06-lwg-21] P3149R11 async_scope - Creating scopes for non-sequential concurrency #8027

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

burblebee
Copy link
Contributor

@burblebee burblebee commented Jun 27, 2025

[exec.associate]p12 Renamed "scope_token" to "scope_tkn" due to libconcept of
the same name.
[exec.spawn.future]p2 [exec.spawn]p2 Employ bullets. [exec.stop.when]p3 [exec.counting.scope]p11 Merged paragraphs via bullets for
clarification ("sndr" and "token" aren't defined otherwise and get confused
with the \exposids of the same name).
[exec.counting.scopes.general] Added missing \expos comments. [exec.counting.scopes.general] Fixed "close" in scope-state-type to "closed". [exec.counting.scopes.general]p1.3 Changed "the scope" to "scope".

Fixes #7958.
Fixes cplusplus/papers#1800

@jensmaurer
Copy link
Member

[exec.associate]p12 Renamed "scope_token" to "scope_tkn" due to libconcept of the same name.

That's not really a hard conflict due to name lookup rules, right?

[exec.associate]p12 Renamed "scope_token" to "scope_tkn" due to libconcept of
  the same name.
[exec.spawn.future]p2 [exec.spawn]p2 Employ bullets.
[exec.stop.when]p3 [exec.counting.scope]p11 Merged paragraphs via bullets for
  clarification ("sndr" and "token" aren't defined otherwise and get confused
  with the \exposids of the same name).
[exec.counting.scopes.general] Added missing \expos comments.
[exec.counting.scopes.general] Fixed "close" in scope-state-type to "closed".
[exec.counting.scopes.general]p1.3 Changed "the scope" to "scope".
@burblebee burblebee force-pushed the motions-2025-06-lwg-21 branch from ed9536d to 109df4b Compare June 30, 2025 23:31
@burblebee
Copy link
Contributor Author

[exec.associate]p12 Renamed "scope_token" to "scope_tkn" due to libconcept of the same name.

That's not really a hard conflict due to name lookup rules, right?

check-output.sh won't allow it.

@burblebee burblebee marked this pull request as ready for review July 1, 2025 01:36

\item%
when an object scope of type
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
when an object scope of type
when an object \tcode{scope} of type

\tcode{std::execution::simple_counting_scope} or
\tcode{std::execution::counting_scope}
is destroyed and
\tcode{scope.state} is not equal to
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
\tcode{scope.state} is not equal to
\tcode{scope.\exposid{state}} is not equal to


auto query(execution::get_scheduler_t) const noexcept {
return @\exposid{loop}@->get_scheduler();
\indexlibraryglobal{execution::\exposid{associate-data}}%
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To my knowledge, we don't index exposition-only declarations.

\begin{itemdescr}
\pnum
\constraints
copy_constructible<\exposid{wrap-sender}> is \tcode{true}.
Copy link
Member

@Eisenwave Eisenwave Jul 11, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
copy_constructible<\exposid{wrap-sender}> is \tcode{true}.
\tcode{\libconcept{copy_constructible}<\exposid{wrap-sender}>} is \tcode{true}.

Or equivalently

\exposid{wrap-sender} satisfies \libconcept{copy_constructible}

but it's better to preserve the wording as is here.

@\exposid{state}@->@\exposid{loop}@.finish();
\end{codeblock}
Initializes \exposid{sndr} with \tcode{std::move(other.\exposid{sndr})} and
initializes \exposid{token} with \tcode{std::move(other.\linebreak{}\exposid{token})} and
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
initializes \exposid{token} with \tcode{std::move(other.\linebreak{}\exposid{token})} and
initializes \exposid{token} with \tcode{std::move(other.\brk{}\exposid{token})} and

\linebreak forces a linebreak, which can cause problems when the paragraph is changed in the future. We have \brk{} for this (see macros.tex) which adds a discretionary line break.

\tcode{\libconcept{scope_token}<Token>}, or
\tcode{\exposconcept{queryable}<Env>}
are not satisfied,
the expression \tcode{spawn(\linebreak{}sndr, token, env)} is ill-formed.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
the expression \tcode{spawn(\linebreak{}sndr, token, env)} is ill-formed.
the expression \tcode{spawn(\brk{}sndr, token, env)} is ill-formed.

Comment on lines +5600 to +5603
auto token = std::move(this->@\exposid{token}@);

@\exposid{destroy}@();
token.disassociate();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The paper has a blank line between each statement. I think we should either do what the paper says, or just get rid of all. The blank line after auto token is not really necessary.


\pnum
The expression \tcode{spawn(sndr, token)} is expression-equivalent to
\tcode{spawn(sndr, token, execution::env<>(\linebreak{}))}.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
\tcode{spawn(sndr, token, execution::env<>(\linebreak{}))}.
\tcode{spawn(sndr, token, execution::env<>(\brk{}))}.

has type \exposid{run-loop-scheduler}, and
compares equal to the \exposid{run-loop-\newline scheduler} instance
from which \exposid{sndr} was obtained.
given an lvalue token of type (possibly const) \tcode{Token},
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
given an lvalue token of type (possibly const) \tcode{Token},
given an lvalue \tcode{token} of type (possibly const) \tcode{Token},

\pnum
For purposes of determining the existence of a data race,
\tcode{get_token},
\tcode{close}, \tcode{join},
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
\tcode{close}, \tcode{join},
\tcode{close},
\tcode{join},

@Eisenwave
Copy link
Member

I think I've missed a few \linebreak -> \brk chnages; anyhow, all of those should be changed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants