[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

is rubyzip threadsafe ?

come

10/29/2007 5:07:00 PM

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