-
Notifications
You must be signed in to change notification settings - Fork 1k
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
[try_put_and_wait] Add tag-based implementation for try_put_and_wait for multifunction and async nodes #1604
Draft
kboyarinov
wants to merge
11
commits into
master
Choose a base branch
from
dev/kboyarinov/try_put_and_wait_multioutput_new
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from 9 commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
faaefb2
Add impl
kboyarinov ef41553
Draft unique-ptr-based implementation
kboyarinov 8e14ce1
Save progress
kboyarinov b8149b0
Save progress
kboyarinov d9ebc3b
Add async_node implementation and tests
kboyarinov 64b9d92
Update copyright years
kboyarinov ebb4194
Fix minor compilation issues
kboyarinov c1a1cc0
Fix lightweight test
kboyarinov 9357efb
Fix copyrights & remove unnecessary comments
kboyarinov 8ab461b
Fix copyright in test_function_node
kboyarinov a0d26a1
Fix C++20
kboyarinov File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could someone want to use assignment in place of reset to start a next batch of accumulations -- starting with a different first tag. Then there could be a race between the assignment and merge..?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is in theory really interesting, which thread-safety guarantees should be provided.
It is obvious, that:
merge
should be thread-safe with othermerge
reset
should be thread-safe withreset
merge
can be thread-safe withreset
(as well as withoperator=
) but it is hard to imagine the real use case. If we have bothmerge
andreset
simultaneously, which result can the user expect - merged or reset object.Currently, the first function that acquires the mutex will define the behavior.
But let's consider the 2 consecutive reductions that use the single accumulators. If in the edge between 2 reductions, there would be simultaneous
merge
from reduction 2 andreset
from the reduction 1, some elements from the reduction 2 can be missed if the merge will go before the reset.For me, it is unclear how we can manage this. I think the answer for this question is the answer also to thread-safety of
operator=
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Other interesting question is should it be thread-safe to have the
left.merge(middle)
simultaneous withmiddle.merge(right)
. I feel that the answer is no, but still want to highlight this.