|
Post by steveo on Oct 17, 2006 4:44:56 GMT -5
Hi, I've got a main form and a thread which does most of the work. The thread has a number of unzip operations to do and at the moment I'm creating the vclUnzip component in code at thread.execute. It all works fine but the I want to separate of some of the things I'm oing in the thread to procedures called from within the thread to improve readability of my code. Now I seem to have two choices - create the vclUnzip component in each procedure as required or else drop a vclUnzip component on the main form and use it from each procedure. I only have a single thread so each procedure called from within the thread will run in 'blocking' mode - there is no risk of the vclUnzip component being called simultaneously by differetn procedure. Any advice?? Thanks, Steve
|
|
|
Post by Kevin on Oct 18, 2006 21:26:48 GMT -5
As long as you synchronize things it shouldn't matter which way you do it.
Kevin
|
|
|
Post by steveo on Oct 19, 2006 4:45:17 GMT -5
Kevin,
Even though vclUnzip is a non visual component, should I always use thread.Synchronise to access its methods, poprerties etc?
Thanks, Steve
|
|
|
Post by Kevin on Oct 23, 2006 20:06:48 GMT -5
The main thing is to be sure you never call any VCLZip method until the one that is running is finished. So it is definitely safest to create separate instances of VCLZip for each thread. However, you also don't want separate instances of VCLZip processing the same zip file at the same time. So it depends somewhat on just what your application will be doing with the zip files that it is manipulating.
|
|