Skip to content

Make start_now's request_stop reach its senders - #2417

Open
Nas01010101 wants to merge 1 commit into
NVIDIA:mainfrom
Nas01010101:start-now-request-stop
Open

Nas01010101 wants to merge 1 commit into
NVIDIA:mainfrom
Nas01010101:start-now-request-stop

Conversation

@Nas01010101

Copy link
Copy Markdown

Fixes #2416

__scope.nest() replaces the stop token in the receiver's environment with the scope's token, so a stop request on the start_now storage never reached the senders.

This change wraps each sender in __stop_when with the storage's token before nesting it. The sender then responds to both the storage and the scope. __counting_scopes.hpp and __spawn_future.hpp use __stop_when the same way.

Tests

Added to test/exec/async_scope/test_start_now.cpp:

  • start_now request_stop stops the senders fails without the change in start_now.hpp.
  • start_now senders still stop with the scope passes with and without it, and covers the scope's stop request.

test_start_now.cpp is the only file that includes start_now.hpp. That test file passes on:

Compiler Flags
clang 21.1.8 -O0 -Wall -Wextra -Werror
clang 21.1.8 -O0 -fsanitize=address,undefined
clang 21.1.8 -O1 -fsanitize=thread
clang 21.1.8 -O2 -std=c++23
g++ 13 -O0
g++ 14 -O0 -fsanitize=address
g++ 15 -O2 -std=c++23

A separate program stopped a sender running on static_thread_pool, 300 times through the storage and 300 times through the scope, with no reports under TSan or ASan/UBSan.

test.exec built with CMake (clang 21.1.8, Debug, C++20) passes all 507 test cases. libc++ and nvc++ were not run locally.

@copy-pr-bot

copy-pr-bot Bot commented Nov 5, 2026

Copy link
Copy Markdown

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

This branch has not been deployed

No deployments
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.

exec::start_now: request_stop() on the storage does not reach the senders

1 participant