Skip to content

Conversation

@tomaszkam
Copy link

No description provided.

<li>-4.4- <tt><i>prom</i>.token.stop_requested()</tt> returns <tt>st.stop_requested()</tt>;</li>
<li>-4.5- <tt><i>prom</i>.token.stop_requested()</tt> returns <tt>st.stop_requested()</tt><del>;</del><ins>.</ins></li>
<li><del>-4.6- for types `Fn` nad `Init` such that both <tt>invocable&lt;Fn&gt;</tt> and <tt>constructible_from&lt;Fn, Init&gt;</tt> are modeled,
<tt>stop_token_type::callback_type&lt;Fn&gt;</tt> modes l<tt>stoppable-callback-for&lt;Fn, stop_token_type, Init&gt;</tt>.</del></li>

Choose a reason for hiding this comment

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

I think we are missing a requirement that requesting stop on st's stop source results in invocation of the callbacks registered with the task's. I wonder if that is what this was trying to say (but totally failing to).

Copy link
Author

Choose a reason for hiding this comment

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

I think this is implied by stoppable-callback-for semantics requirements (https://eel.is/c++draft/thread.stoptoken#stoptoken.concepts-3.2.1.3.) and the fact that stop_requested and stop_possible are propagated fro st to prom.token.

Choose a reason for hiding this comment

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

I don't think we actually say that the propagation of stop_requested amounts to making a stop request on prom.source.

Copy link
Author

@tomaszkam tomaszkam Dec 8, 2025

Choose a reason for hiding this comment

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

That's intended (as far as I remember), because if you stop_token_type is the same as st, then no propagation is required. You can just initialize _prom_.token with st.

Copy link
Author

Choose a reason for hiding this comment

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

But, I do not see how you may mentain equivalent returns for st.stop_requested() and prom.token.stop_requested() without it.

Copy link
Author

@tomaszkam tomaszkam Dec 8, 2025

Choose a reason for hiding this comment

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

We are missing a qualifier that would say that these properties hold when asynchronous operation is active, and thus forcing changes of values of stop_requested,stop_possiblei.e. this should say something like:
Initializes prom.token and prom.source such that at any point before asynchrous operation associated with *this completes:

Copy link
Author

Choose a reason for hiding this comment

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

Update the wording, let me know what you think.

@tomaszkam
Copy link
Author

@jwakely do you mind merging it before today telefon?

@jwakely jwakely merged commit 08fbcc3 into cplusplus:master Dec 12, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants