-
Notifications
You must be signed in to change notification settings - Fork 384
Improvement thread storage from std::array to stable_vector with dynamic growth #2542
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
Closed
anujshuk-amd
wants to merge
5
commits into
develop
from
anujshuk/anujshuk-amd/dynamic-thread-storage
+29
−7
Closed
Changes from 3 commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
3971d01
Convert thread storage from std::array to std::vector with dynamic gr…
anujshuk-amd b68a11b
Convert thread storage from std::array to std::vector with dynamic gr…
anujshuk-amd ea379a7
refactor: address code review comments for dynamic thread storage
anujshuk-amd e9a38d4
Apply clang-format-18 to config.cpp and counters.hpp
anujshuk-amd ff0473d
Merge branch 'develop' into anujshuk/anujshuk-amd/dynamic-thread-storage
anujshuk-amd 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
Submodule timemory
updated
2 files
| +53 −5 | source/timemory/operations/types.hpp | |
| +1 −1 | source/timemory/utility/filepath.cpp |
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
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
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 observed a potential data race edge case
The atomic capacity check on lines 178-179 doesn't fully protect against a concurrent resize. If ensure_capacity() reallocates the vector while this read is in progress, the reader could access freed memory.
Scenario:
Practical risk: Only occurs when exceeding ROCPROFSYS_MAX_THREADS(4096) during concurrent access. When we run AI workloads like tensorflow workloads then it easily exceeds MAX_THREADS but not in other cases.
Not blocking, but worth noting for future consideration: