-
Notifications
You must be signed in to change notification settings - Fork 80
Do checked_import sequentially #276
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
Conversation
|
The same fix is needed for ImageIO JuliaIO/ImageIO.jl#11 |
Codecov Report
@@ Coverage Diff @@
## master #276 +/- ##
==========================================
- Coverage 73.36% 73.12% -0.25%
==========================================
Files 8 8
Lines 443 439 -4
==========================================
- Hits 325 321 -4
Misses 118 118
Continue to review full report at Codecov.
|
|
Is there an easy test we can add? Feel free to merge whenever, though. |
|
I just added a multithreaded test here, but without bringing an external IO dependency into the testing, I don't see an easy way for the module load segfault issue to be fully tested here. This issue is however tested properly in ImageIO as of JuliaIO/ImageIO.jl#11 I think I'll merge once CI passes (travis seems to be having a bit of a hiccup) |
|
The original user reports that master (as well as ImageIO master) fixes this. Should I release 1.4.4? |
|
Yes please! |
The issue at the bottom was submitted to the julia discourse https://discourse.julialang.org/t/segfault-while-loading-images-in-multiple-threads/48878
This PR locks
checked_importto ensure that loading is sequential in threaded use cases. The cost of the lock when the module is already loaded is negligible.checked_importexecution times in a png-loading loop:This may slow down parallel loops with heterogenous file types, but even in that case we can't be sure that the IO packages they're loading are themselves using independent deps, so perhaps better to be safe.
Issue from Discourse: