move package loading behind a lock - #339
Conversation
Codecov Report
@@ Coverage Diff @@
## master #339 +/- ##
==========================================
- Coverage 88.11% 6.31% -81.81%
==========================================
Files 10 10
Lines 631 618 -13
==========================================
- Hits 556 39 -517
- Misses 75 579 +504
Continue to review full report at Codecov.
|
johnnychen94
left a comment
There was a problem hiding this comment.
Perhaps this indicates that Base.require itself is not threadsafe, because it appears to use plain Base.Condition, rather than Threads.Condition.
Just curious, could this be fixed in upstream Julia?
|
Maybe, but I don't think that lock is really for concurrency safety but to limit recursive |
|
I'll set up the CI and check if it works (tomorrow); I have good reason to believe this is the right fix but we still need to appropriately test it. |
| :save => save, | ||
| :savestreaming => savestreaming) | ||
|
|
||
| const require_lock = ReentrantLock() |
There was a problem hiding this comment.
It looks like for Julia < v1.3, Threads.SpinLock() is required here. Maybe we should it for all Julia versions?
|
Some strange behavior here when testing CSVFiles: cc: @davidanthoff |
only run threaded test on Julia >= 1.3
ff11abb to
b0abfe1
Compare
|
Given that multi-threads are not very well supported before Julia 1.3, I decided to only test this with Julia >= 1.3. I've locally tested it for all minor versions from 1.3-1.6 on my macOS and Ubuntu. For Julia 1.1 it can be fixed by using This is only a partial fix to #336 for Julia >= 1.3. |
|
@johnnychen94 sorry, only catching up right now with notifications. Was the problem with CSVFiles.jl resolved before this was merged? Or is there still something I should look into? |
|
@davidanthoff It was then identified an unrelated issue. Sorry for the spam! |
Ref #336, not sure if it completely fixes the issue.