We help IT Professionals succeed at work.

MutliThreading, each thread will scan multiply folders.

systan asked
"MutliThreading, each thread will scan multiply folders."
That is according to Member_2_5194534;

I have seen running code of multithreading's;
file multi-threading - does thread on each file in maximum number of threads (not so slow)
drive multi-threading - does thread on each drive, number of threads depending on number of drives. (very slow)

What about Member_2_5194534 said?  folder multi-threading - assign a maximum number of threads and designate it on every folder.

Is it scanning a files through folder multi-threading is better than the 2(file, drive)multithreading?
Watch Question

Top Expert 2010
to illustrate my previous post. I have two HDD. My C: is located at 1st one, D: is located at the 2nd one. The both have around 1000 files. I ran scan process a few times, to fill the system cache and then ran the test scan (they are the 1st and the 2nd thread projects, that I gave you):

1. sequential scanning (C:, then D:) - 6672 milliseconds
2. disk threading - 6563 milliseconds

> Ok, ciuly's multithreading code is slow?  

Have no idea. Give me a link pls.
Geert GOracle dba
Top Expert 2009
um... if you want a good place (with all the nooks and crannies) to find out about delphi threading
(i have to warn you, it's high level stuff), follow this link:

it's a full blown engine for managing running threads

for example: if you want to scan 1000 files, and set the number of worker threads to 20
then the engine will keep a maximum of 20 threads running to do the job
in this scenario the harddisk controller would be the bottleneck and the cpu.
reading from 1 unit and processing in 1 unit