forked from HDFGroup/hdf5
-
Notifications
You must be signed in to change notification settings - Fork 0
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
Implement assert-based virtual locks on IDs #7
Open
mattjala
wants to merge
5
commits into
multithread_h5vl
Choose a base branch
from
mt_vl_virtual_locks
base: multithread_h5vl
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.
Conversation
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 was referenced Nov 14, 2024
mattjala
force-pushed
the
mt_vl_virtual_locks
branch
2 times, most recently
from
November 15, 2024 20:41
062140b
to
1f74b5b
Compare
mattjala
force-pushed
the
multithread_h5vl
branch
from
November 20, 2024 14:26
3f05a46
to
fe632c0
Compare
mattjala
force-pushed
the
mt_vl_virtual_locks
branch
from
November 20, 2024 14:30
1f74b5b
to
fb1ef77
Compare
mattjala
force-pushed
the
multithread_h5vl
branch
from
November 20, 2024 21:13
fe632c0
to
005ab57
Compare
mattjala
force-pushed
the
mt_vl_virtual_locks
branch
from
November 20, 2024 21:13
fb1ef77
to
b8e4cab
Compare
mattjala
force-pushed
the
multithread_h5vl
branch
2 times, most recently
from
November 21, 2024 16:44
80bced4
to
855ea52
Compare
mattjala
force-pushed
the
mt_vl_virtual_locks
branch
from
November 21, 2024 16:44
b8e4cab
to
2ad4f09
Compare
mattjala
force-pushed
the
multithread_h5vl
branch
from
November 21, 2024 20:49
855ea52
to
b3b95e1
Compare
mattjala
force-pushed
the
mt_vl_virtual_locks
branch
from
November 21, 2024 20:49
2ad4f09
to
80a50a5
Compare
mattjala
force-pushed
the
multithread_h5vl
branch
3 times, most recently
from
November 26, 2024 15:15
ea71c8c
to
7c3bdd3
Compare
mattjala
force-pushed
the
mt_vl_virtual_locks
branch
from
November 26, 2024 15:17
80a50a5
to
2978a6e
Compare
mattjala
force-pushed
the
multithread_h5vl
branch
from
November 26, 2024 15:19
7c3bdd3
to
06258ba
Compare
mattjala
force-pushed
the
mt_vl_virtual_locks
branch
from
November 26, 2024 15:20
2978a6e
to
4cf1d75
Compare
mattjala
force-pushed
the
multithread_h5vl
branch
4 times, most recently
from
November 26, 2024 19:52
b17a009
to
8879327
Compare
mattjala
force-pushed
the
mt_vl_virtual_locks
branch
from
November 26, 2024 19:53
4cf1d75
to
2f7d9a9
Compare
mattjala
force-pushed
the
multithread_h5vl
branch
3 times, most recently
from
December 6, 2024 16:31
cb61a02
to
fc31a40
Compare
mattjala
force-pushed
the
multithread_h5vl
branch
from
December 10, 2024 16:38
fc31a40
to
767abbe
Compare
mattjala
force-pushed
the
multithread_h5vl
branch
from
December 17, 2024 19:20
767abbe
to
5e03095
Compare
mattjala
force-pushed
the
mt_vl_virtual_locks
branch
from
December 19, 2024 17:16
2f7d9a9
to
61fe6b0
Compare
mattjala
force-pushed
the
multithread_h5vl
branch
from
December 19, 2024 19:40
5e03095
to
9290a9e
Compare
mattjala
force-pushed
the
mt_vl_virtual_locks
branch
from
December 19, 2024 19:40
61fe6b0
to
49913f4
Compare
mattjala
force-pushed
the
multithread_h5vl
branch
from
December 23, 2024 18:18
9290a9e
to
8f132e8
Compare
mattjala
force-pushed
the
mt_vl_virtual_locks
branch
3 times, most recently
from
December 24, 2024 16:46
f967ee4
to
13c35d4
Compare
mattjala
force-pushed
the
multithread_h5vl
branch
from
December 24, 2024 21:44
8f132e8
to
610b651
Compare
mattjala
force-pushed
the
mt_vl_virtual_locks
branch
from
December 24, 2024 21:46
13c35d4
to
baf19b9
Compare
mattjala
force-pushed
the
mt_vl_virtual_locks
branch
from
December 30, 2024 14:57
baf19b9
to
de44883
Compare
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.
Implement virtual locks for IDs
When the library is built in debug mode, H5I will track how many concurrent API routines reference application-exposed IDs passed in through the H5VL API, and throw an assertion if an ID is simultaneously provided to more library threads than its reference count permits. The purpose of this is to help multi-threaded application developers detect invalid API usage early on in development.
The virtual locks are implemented by allowing variants of the
FUNC_ENTER
andFUNC_LEAVE
macros to take a variable numbers of IDs as additional arguments.The
_NOINIT
enter/exit variants do not interact with the virtual locks, since routines using these macros generally aren't meant to be directly used by applications (e.g. the routines for passthrough VOLs inH5VLcallback.c
).There are a few other factors the virtual locks must consider which complicate the implementation somewhat:
H5VLunregister_connector()
). If using a simple virtual lock scheme, a routine that decrements the app ref count before calling the virtual lock exit would create a region where another thread could, on entry, apparently find the ID exceeding its application reference count, even though the usage is valid. The solution is that routines which decrement the app ref count indicate that an "application unlock" has taken place on the ID. Verification of ID ref counts compare the virtual lock count to the sum of application references plus 'application unlocks'. The application unlock count also serves to prevent double-counting of virtual lock releases inH5I_vlock_exit()
.