I disagree with some statements here guys.
First of all, I do not see the difference between ThreadPool and tasks in coordination or control. Especially when tasks are performed on ThreadPool and you have easy control over tasks, exceptions are well conveyed to the caller while waiting or waiting in Tasks.WhenAll (tasks), etc.
Secondly, I / O will not necessarily be the only bottleneck here, depending on the data and the compression level, ZIPping will take msot, rather, more time than reading a file from disk.
This can be judged in different ways, but Iβd better go for something like the number of processor cores or a little less.
Download file paths in ConcurrentQueue, and then run the running tasks to delete files, download files, replace them, and save.
From there, you can configure the number of cores and play with load balancing.
I don't know if ZIP supports file partition support during compression, but in some complex / complex cases this might be a good idea, especially for large files ...
WOW, question 6 years old, bummer! I did not notice...:)
ipavlu
source share