Question Multithreading a for loop?

zacatictac

New member
Joined
Feb 27, 2011
Messages
1
Programming Experience
Beginner
Hey guys I was wondering if somone one could point me in the right direction on this.

Basically I am making a proxy testing program. A user can supply a list of proxies to test. What i want to be able to do is have them be able to specify how many threads they want to run. Then have the program go through the list testing each one using the amount of threads supplied. Really not sure even where to start on this. Threadpooling?

any advice would be appreciated. thanks!
 
You could use the Threadpool and SetMaxThreads, then perhaps use the ConcurrentQueue(Of T).
Another option could be a Parallel.ForEach on a collection/array, and set MaxDegreeOfParallelism for its ParallelOptions.
 
Back
Top