Skip to content

async chunk writing #125

Answered by meggart
kongdd asked this question in Q&A
Discussion options

You must be logged in to vote

I am not really sure what the context is. It is completely fine if multiple processes write simultaneously into the same Zarr dataset, but it is up to the user/library to make sure that different processes/threads never write into the same chunk. So the following is fine:

using Zarr
a = zzeros(Float64,10,10,chunks=(10,1),path=tempname())
@sync for i=1:10
  @async a[:,i] = rand(10)
end
a[:,:]

However, when using multiple threads there may be problems coming from the different compression/decompression libraries, which are not thread-safe, so be careful when using compression.

Otherwise when writing across several chunks in a single call to setindex!, it will depend on the backend if chunks…

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by bjarthur
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants