I have several thousand items. For each element, I need to load a web page and process this web page. Processing itself does not require a large processor overhead.
Right now, I am doing this synchronously using the webclient class, but it takes too much time. I am sure it can be easily paralyzed / asynchronized. But I'm looking for the most resource-efficient way to do this. Perhaps there are some restrictions on the number of active web requests, so I don’t like the idea of creating thousands of web clients and running asynchronous work on each of them. If this is not a real problem.
Is it possible to use parallel extensions and the Task class in C # 4?
Edit: Thanks for the answers. I was hoping for something using asynchronous operations, because the execution of a synchronous operation in the parallel will block only this thread.
source
share