jakobnissen / CodecBGZF.jl

BGZF codecs for TranscodingStreams.jl
MIT License
2 stars 1 forks source link

Fix multithreaded writing #1

Open jakobnissen opened 3 years ago

jakobnissen commented 3 years ago

MWE:

CodecBGZF.jl on  master via C base took 18s ❯ julia --project=. --startup-file=no -q -t 3
julia> using CodecBGZF

julia> open("/tmp/foo.bgz", "w") do file
           io = BGZFCompressorStream(file)
           write(io, [1,2,3,4])
           close(io)
       end

julia> open(x -> read(BGZFDecompressorStream(x)), "/tmp/foo.bgz")
UInt8[]

It works with 1 and 2 threads.

Also, this package REALLY needs to have some multithreaded testing.

CiaranOMara commented 1 year ago

The following is likely relevant here. https://github.com/BioJulia/BGZFStreams.jl/pull/27