I have a list of URLs and I am creating an HTTP web request object and trying to connect to it, I have an "array" url and I am trying to connect to each of them. the goal is to see which ones are missing.
It already works, but one request only starts after the last one is completed, so it runs slowly, about two requests per second.
I was wondering if I should make about 5 threads running in the background, which will make it 5 times faster, which is the desired speed (without overloading the general Internet range). But I have two problems:
1 - I don’t even know IF this is the best solution for my problem. 2 - I tried several times, but I'm new to the .NET framework and have never used multithreading. so I don’t know how I would do it easily.
I have a start () function, and it has a For value, which goes through all the URL validation checks.
: VS 08, .NET 3.5, C #.
- [edit] -
Can someone tell me (with sample code) how to use five (not as much as possible) threads in the background? how about starting right after the last processing?
source
share