Delphi Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreDelphi Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old June 25th, 2005, 09:09 AM
alfmarc alfmarc is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2005
Posts: 3 alfmarc User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 26 m 19 sec
Reputation Power: 0
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

Reply With Quote
  #2  
Old June 25th, 2005, 11:44 AM
CyberAlien CyberAlien is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2005
Posts: 24 CyberAlien User rank is Private First Class (20 - 50 Reputation Level)CyberAlien User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 2 h 57 m 16 sec
Reputation Power: 0
Try pre-reading files in memory, then compressing in memory, then writing large block so there would be less disk access.

Reply With Quote
  #3  
Old June 25th, 2005, 03:44 PM
alfmarc alfmarc is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2005
Posts: 3 alfmarc User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 26 m 19 sec
Reputation Power: 0
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

Reply With Quote
  #4  
Old June 25th, 2005, 04:54 PM
CyberAlien CyberAlien is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2005
Posts: 24 CyberAlien User rank is Private First Class (20 - 50 Reputation Level)CyberAlien User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 2 h 57 m 16 sec
Reputation Power: 0
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.

Reply With Quote
  #5  
Old June 26th, 2005, 08:54 AM
alfmarc alfmarc is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2005
Posts: 3 alfmarc User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 26 m 19 sec
Reputation Power: 0
Thank you very much! Now I understood and I will change my code to use large blocks.

Alfeu

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreDelphi Programming > Thread and slow HD access


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway
Stay green...Green IT