TBB executor for GAPI: fix race consition in Async test#18982
Merged
opencv-pushbot merged 1 commit intoopencv:masterfrom Dec 1, 2020
Merged
TBB executor for GAPI: fix race consition in Async test#18982opencv-pushbot merged 1 commit intoopencv:masterfrom
opencv-pushbot merged 1 commit intoopencv:masterfrom
Conversation
The test has race condition, which is addressed by the patch.
The race is next:
Master thread is calling execute (effectively blocked, waiting for
callback to be called)
"Async" thread picks up the callback
Call the callback
Then sets the variables in test
After call back is called, master thread is unblocked and may check
the variables (set in point 4 by the "async" thread) earlier then they
actually changed
Changes:
callback should be called as the last step (after flag variables are
set), as it effectively unblock the master thread
fixes opencv#18974
Contributor
|
@anton-potapov The patch includes some fixes in Python code that are not relevant to your bug. Please rebase the patch ans fix conflicts. |
1232a87 to
eb6d8e6
Compare
Contributor
Author
updated |
rgarnov
approved these changes
Dec 1, 2020
Contributor
Author
|
@alalek please merge it |
Merged
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
The test has race condition, which is addressed by the patch.
The race is next:
execute(effectively blocked, waiting for callback to be called)Changes:
set), as it effectively unblock the master thread
fixes #18974
Pull Request Readiness Checklist
See details at https://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request
Patch to opencv_extra has the same branch name.