# Is rubyzip threadsafe?

**URL:** <https://www.ruby-forum.com/t/is-rubyzip-threadsafe/118644>\
**Category:** Ruby\
**Created:** [October 29, 2007, 6:57pm UTC](https://www.ruby-forum.com/t/is-rubyzip-threadsafe/118644 "2007-10-29T18:57:02Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![come](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/9f8e36/32.png) [@come](https://www.ruby-forum.com/u/come)\
**Post date:** [October 29, 2007, 6:57pm UTC](https://www.ruby-forum.com/t/is-rubyzip-threadsafe/118644/1 "2007-10-29T18:57:02Z")

</div>

Hi,

I wrote a program where many threads access a same uniq zip file.  
Right now, I’m using the Monitor Mixin to ensure the thread safety :

Zip::ZipFile.open(“my\_file.zip”, Zip::ZipFile::CREATE) do |zipfile|  
zipfile.extend(MonitorMixin)  
(…)  
zipfile.synchronize { zipfile.dir.mkdir(…) }  
(…)  
zipfile.synchronize { zipfile.file.open("…") { |f| f.puts … } }  
end

But I feel it’s not necessary to take care of this in my case. Am I  
right ?

Come
