H
HK
With VB.NET 2005, and a Windows Form, running on a dual CPU box, I need to
take a recordset (e.g. 100,000 records) and spawn a thread to handle an
internet XML transaction routine for each of the records. This is a nice
use of threading because those internet requests are going against 3rd party
servers that often have 1 second latency problems and so handling them with
multiple threads is the fastest way to get through all the records in the
recordset. I'd like to set a variable/constant that controls the number
of threads that are allowed to run simultaneously and have the code keep
spawning threads up to the number. Then, I can play with that number and
find out what # of threads works best. But I'm not the threading expert
and I don't know what new options I have with .NET 2.0 framework. I also
can't find any example that shows threads being repeatedly spawned up to a
certain number in an effort to work through a single recordset. Obviously
each thread need to communicate back to the main routine when done (fire an
event??) and that main routine would need to then take the next record and
throw it to another thread, if # threads is less than max # threads. Can
someone please help me with the pseudocode for this, or better yet, point me
to a real code example that does this?
take a recordset (e.g. 100,000 records) and spawn a thread to handle an
internet XML transaction routine for each of the records. This is a nice
use of threading because those internet requests are going against 3rd party
servers that often have 1 second latency problems and so handling them with
multiple threads is the fastest way to get through all the records in the
recordset. I'd like to set a variable/constant that controls the number
of threads that are allowed to run simultaneously and have the code keep
spawning threads up to the number. Then, I can play with that number and
find out what # of threads works best. But I'm not the threading expert
and I don't know what new options I have with .NET 2.0 framework. I also
can't find any example that shows threads being repeatedly spawned up to a
certain number in an effort to work through a single recordset. Obviously
each thread need to communicate back to the main routine when done (fire an
event??) and that main routine would need to then take the next record and
throw it to another thread, if # threads is less than max # threads. Can
someone please help me with the pseudocode for this, or better yet, point me
to a real code example that does this?