KillingSpark/zstd-rs

Make RingBuffer Send and Sync

Closed this issue · 5 comments

FrameDecoder is currently !Send and !Sync due to core::ptr::NonNull being as such.

I think it would be alright to add Send and Sync impls for RingBuffer as I don't see any way that memory held by the buffer could be aliased or any interior mutability used in the struct.
Could you please check this and consider making RingBuffer Send and Sync?

I don't see why it shouldn't be Send + Sync. I'll add those impls.

Out of curiosity, how did this come up?

Could you confirm that a16e38b resolves this issue before I make a new release?

Yeah, thanks, that works!

chd-rs recently added support for CHDs that use Zstandard compression, and Chd lost the Send + Sync markers because FrameDecoder is kept as state.

In my image access crate I've been moving the Chd to another thread, but that broke because it's no longer Send.

Released as 0.6.0 because other pending were potentially breaking based on crate features. So chd-rs will need to update their ruzstd dependency :/

Thanks and no problem, it has to be made explicit on CompressionCodec anyway.