-
Notifications
You must be signed in to change notification settings - Fork 674
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
Added code to make pointer vector be thread safe #1325
Closed
Closed
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
3cf67aa
Added code to make pointer vector be thread safe
muthusaravanan3186 6fefefb
Addressed the review comments
muthusaravanan3186 5ece0be
Resolved the merge conflicts
muthusaravanan3186 ddbfe88
Fixed compiler issues that introduced while resolving the merge confl…
muthusaravanan3186 5c6c369
Fixed compiler issues that introduced while resolving the merge confl…
muthusaravanan3186 03989cc
Merge remote-tracking branch 'upstream/dev' into dev
muthusaravanan3186 8dbb970
Addressed the review comments
muthusaravanan3186 37dea48
Addressed the review comments
muthusaravanan3186 e2addf2
Merge remote-tracking branch 'upstream/dev' into dev
muthusaravanan3186 21083fe
ran pre-commit hooks
muthusaravanan3186 070b8a3
Merge branch 'dev' into dev
seladb 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
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.
I don't think this protects as much as you would think.
Yes, you don't get data races when obtaining the iterator but vector iterators generally modify the vector memory on their own, so after the safety car is gone (begin iterator is obtained), all the threads are free to race again via direct iterator modification.
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.
This is the case on normal scenario too even without multi threading environment. we get an iterator and after some time vector reconstructs itself then the above iterator will be undefined.
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.
True, tho in a non-multithreaded scenario you don't have the option of another thread invalidating your iterator whenever. Iterators are invalidated in specific documented calls and the sequence of those calls in relation to iterator usage is deterministic.
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.
we are planned to use shared_ptr in another PR
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.
Perhaps we want to add this line (and all other similar ones) later when you raise another PR.