J
John Baro
I have an app that spawns a thread to copy some files.
The spawned thread then spawns threads to copy individual files and wait for
the specific file to finish copying or timeout.
The specific file copy procedure raises an event which gets handled in the
main form from where the original thread was spawned which then updates a
status box and a progress bar.
The first spawned thread raises a startcopy event which the main form
handles to display the progress bar and a finishcopy event to hide the
progress bar.
This was all working peachy until I moved the individual file copying to
individual threads. After that It was REALLY slow and the progress bar would
not display.
When I set the visibility of the progress bar to TRUE to begin with it works
fine. Even after the progress bar has been hidden by the finishcopy event
and shown again by the startcopy event if I run the routine again.
Now for the question.
Why is this so?
I apologize for the long winded explanation but I really dont understand why
this is.
TIA
JB
P.S. The main form "Freezes" when the progress bar is not visible to begin
with. It wont allow me to resize or do anything whilst the filecopying is
going on, even though it is being run in another thread.
The spawned thread then spawns threads to copy individual files and wait for
the specific file to finish copying or timeout.
The specific file copy procedure raises an event which gets handled in the
main form from where the original thread was spawned which then updates a
status box and a progress bar.
The first spawned thread raises a startcopy event which the main form
handles to display the progress bar and a finishcopy event to hide the
progress bar.
This was all working peachy until I moved the individual file copying to
individual threads. After that It was REALLY slow and the progress bar would
not display.
When I set the visibility of the progress bar to TRUE to begin with it works
fine. Even after the progress bar has been hidden by the finishcopy event
and shown again by the startcopy event if I run the routine again.
Now for the question.
Why is this so?
I apologize for the long winded explanation but I really dont understand why
this is.
TIA
JB
P.S. The main form "Freezes" when the progress bar is not visible to begin
with. It wont allow me to resize or do anything whilst the filecopying is
going on, even though it is being run in another thread.