invenia / JLSO.jl

Julia Serialized Object (JLSO) file format for storing checkpoint data.
MIT License
90 stars 5 forks source link

make _CACHE thread-safe #123

Closed cossio closed 2 years ago

cossio commented 2 years ago

The global variable _CACHE is not thread-safe. This PR should fix that.

codecov[bot] commented 2 years ago

Codecov Report

Merging #123 (e208d35) into master (30ba13a) will increase coverage by 0.84%. The diff coverage is 100.00%.

@@            Coverage Diff             @@
##           master     #123      +/-   ##
==========================================
+ Coverage   96.87%   97.71%   +0.84%     
==========================================
  Files           6        6              
  Lines         224      219       -5     
==========================================
- Hits          217      214       -3     
+ Misses          7        5       -2     
Impacted Files Coverage Δ
src/metadata.jl 100.00% <100.00%> (ø)
src/upgrade.jl 100.00% <0.00%> (ø)
src/file_io.jl 94.44% <0.00%> (+1.46%) :arrow_up:
src/JLSOFile.jl 93.33% <0.00%> (+3.01%) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 30ba13a...e208d35. Read the comment docs.

oxinabox commented 2 years ago

LGTM, though I think a failing multi-threaded test would be a good idea...

Race conditions are basically impossible to unit test.

So I do not think this is required.

cossio commented 2 years ago

@oxinabox @rofinn Should be ready to merge?

cossio commented 2 years ago

Bump :)

cossio commented 2 years ago

Thanks!