|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Thread and slow HD access
I have a program which compact files using the VCLZip inside a thread.
When this program is running with thread priority = Idle and I load a big program like Corel Draw, the load phase of Corel is very slow. Without the zip it takes from 2 to 3 seconds to load but with the zip running it takes more than 1 minute. I checked the priorities of both programs and are ok: zip=1 (Idle) and Corel= 8 (normal). I did several tests with other programs using threads, but without HD access, and all are Ok: the program with slow priority don’t affect the program with highest priority. Any ideas? Thanks Alfeu |
|
#2
|
|||
|
|||
|
Try pre-reading files in memory, then compressing in memory, then writing large block so there would be less disk access.
|
|
#3
|
|||
|
|||
|
Your idea seems a good solution and I will try it but I want understand what is happen.
I did a test with a program which do drawings in the screen with a high priority. My Zip program, in priority=Idle, interrupt HD access completely, thus it should not stop the load of other program, I think. Thanks |
|
#4
|
|||
|
|||
|
Problem is not priority, but slow disk access. When several programs are trying to access small chunks of data from disk access becomes very slow for both programs because those chunks are located in different parts of disk. It is many times faster to read/write large blocks from same disk sector. When you change thread priority to slowest possible (as you did) it still isn't slow enough to make any delays in disk access. So the best solution is to cache data for reading/writing and read/write it in large blocks.
|
|
#5
|
|||
|
|||
|
Thank you very much! Now I understood and I will change my code to use large blocks.
Alfeu |
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > Delphi Programming > Thread and slow HD access |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|