[delphizip] Re: Multithreading

  • From: "Russell Peters" <russellpeters@xxxxxxxxxxx>
  • To: <delphizip@xxxxxxxxxxxxx>
  • Date: Thu, 21 Nov 2002 07:28:43 +1100

You are correct - the dlls don't test that it is a safe threaded operation
and trying to build a zip file on two threads is unsafe .
One can only hope that people attempt to use the available capabilities in a
reasonable manner.
The reason the 'thread safe' dlls were desired was to build a zipfile in the
background for which either dll type can be used, but the differences being
so few I will now distribute the 'safer' version.
Russell Peters
http://www.users.bigpond.com/russellpeters/delphizip.html
----- Original Message -----
From: "James Turner" <james.d.h.turner@xxxxxxxxxxxx>
To: <delphizip@xxxxxxxxxxxxx>
Sent: Wednesday, November 20, 2002 10:39 PM
Subject: [delphizip] Re: Multithreading


>
> In addition to my previous comments, I would like to make it clear that
> simultaneously calling the Zip DLL from multiple threads will fail if two
or
> more threads try to write to the same zip archive simultaneously. This
will
> be true of both the thread-safe* and standard versions. This is why, when
> the subject first came up a week or so ago, I suggested using critical
> sections. In the general case, where file-writing is concerned, using
> critical sections is the only way to ensure that multithreaded code works
> correctly.
>
> *I'm assuming here that the thread-safe version of ZipDLL simply declares
> all global vars as threadvars and does not itself use critical sections -
I
> could be wrong about this.
>
> -- James Turner
> www.skaro.net
>
>
>



Other related posts: