Skip to content

Register parallel group's cancellation handler before initiating the sub-operations.#1756

Open
biljazovic wants to merge 1 commit into
chriskohlhoff:masterfrom
biljazovic:fix-parallel-group-cancellation-race
Open

Register parallel group's cancellation handler before initiating the sub-operations.#1756
biljazovic wants to merge 1 commit into
chriskohlhoff:masterfrom
biljazovic:fix-parallel-group-cancellation-race

Conversation

@biljazovic

Copy link
Copy Markdown

Otherwise the group may complete on another thread before the launch function emplaces into the slot, potentially rendering the slot invalid.

Reproduction: https://godbolt.org/z/893h77vhq

Fixes #1630. Note that #1631 addresses the same issue, but repro still fails with it.

…operations.

Otherwise the group may complete on another thread before the launch function
registers the handler, and the handler's cancellation slot may no longer be valid.
Fixes chriskohlhoff#1630.
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.

Memory Access Violation in ranged_parallel_group_launch After Completion Handler Invocation.

1 participant