[delphizip] no multithread ZipMaster

  • From: "Russell Peters" <russellpeters@xxxxxxxxxxx>
  • To: <delphizip@xxxxxxxxxxxxx>
  • Date: Sun, 17 Nov 2002 11:21:54 +1100

Been testing ZipMaster running on two threads simultaneously and found a 
problem - the callback function.
There is only one copy of it being used by each thread - this might explain the 
(apparently) random exceptions I sometimes get.
There are a number of ways around this problem, I can think of two
    1. use critical sections in the callback function (slows up other thread 
waiting & I don't know how as yet)
    2. make changes to use a class based callback function - in theory same as 
stcall but first arg is self (caller).

I am open to any suggestions, but favour the second way.

The testing also showed me that the callback is used a lot - even if everything 
is ignored.
I propose filtering its use a bit (pass a control flag to control 'types' of 
information sent).

Russell Peters
http://www.users.bigpond.com/russellpeters/delphizip.html

Other related posts: