I have inherited a c# application that samples data from ~380 sites via Webclient downloadfileasync. A separate thread is created for each site! (the downloads each wait a timeout period before downloading the next data - so load is not constant....but still!) Anyway, As the number of sites will increase (likely dramatically) over the next year or so, I would like to change this to a few (reasonable number) of worker threads that issue a bunch of Webclient downloadfileasync calls for a subset of the sites. But I am not sure what might happen if multiple downloads complete concurrently - will the downloadfilecompleted event handler be serialized by webclient? Or can multiple webclient completions occur "simultaneously" (or more likely, interleaved)? Will I be running the risk of one completion corrupting another? Or does anyone have a better suggestion on how to manage the explosion of threads in the current implementation?
Thanks in advance.