G
Guest
Hi,
In my application I create 4 new threads that each do the same code, but do
different amounts of work. The process repeats over and over, so I create
the 4 threads many times. I think however I am not killing of the threads
when I am done, so I am ending up with 8,12,16 etc threads as it repeats.
When each thread completes its work load, how do I kill it off properly.
For example
Thread1 = New Thread(AddressOf ThreadWorkLoad1Job.runBatch)
Thread1.Start()
Thread2 = New Thread(AddressOf ThreadWorkLoad2Job.runBatch)
Thread2.Start()
sub runbatch
process a bunch of data in an sql table
end sub
When the runbatch code completes it seems that the thread(1 or 2) remains
running even though it does no work.
I need something like
sub runbatch
process a bunch of data in an sql table
thread.kill.
end sub
In my application I create 4 new threads that each do the same code, but do
different amounts of work. The process repeats over and over, so I create
the 4 threads many times. I think however I am not killing of the threads
when I am done, so I am ending up with 8,12,16 etc threads as it repeats.
When each thread completes its work load, how do I kill it off properly.
For example
Thread1 = New Thread(AddressOf ThreadWorkLoad1Job.runBatch)
Thread1.Start()
Thread2 = New Thread(AddressOf ThreadWorkLoad2Job.runBatch)
Thread2.Start()
sub runbatch
process a bunch of data in an sql table
end sub
When the runbatch code completes it seems that the thread(1 or 2) remains
running even though it does no work.
I need something like
sub runbatch
process a bunch of data in an sql table
thread.kill.
end sub