-
Notifications
You must be signed in to change notification settings - Fork 91
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
Support for single-file multithreading #403
Comments
Hi @mbauman, this really should be possible.
With the current logic it doesn't work since the same file handle is being used to process reads. And also the JLDFile object has plenty internal caching that could hit race-conditions.
|
How hard would it be for a non-JLD expert to implement this? I have an application where everything threads perfectly but a HDF5 read is the thing preventing me from multi-threading the program. I can change my program to get around this but it would make my code a lot more hacky. |
This wouldn't be very hard and does not require any real JLD2 knowledge. This is the relevant function definition: Line 254 in e746c89
Currently, there is a "global" list that keeps track of all open files and ensures that only a single JLDFile can exist per file.
This condition could be relaxed:
|
implemented by #477 |
#230 implemented thread-safety at a file level. However, if I try to read from a single file from multiple threads, I hit segfaults. I understand that multithreaded writing to a single file is fraught, but would it be a major challenge to support multithreaded reads?
The text was updated successfully, but these errors were encountered: