My application creates threads from the ThreadPool:
Each thread performs it's task (check a website), reports it's progress, then is supposed to quit. I've outputted to the screen when it's done with the method PullRequest but the thread doesn't go away until 5-20 seconds after that. I've set it to only create 5 threads, but there are 20 items queued for processing, so it goes through 15 really quick. The issue is when it's done with the last 5...they just sit there for awhile, then eventually go away.
Is there some kind of cleanup I can call to clear them faster?
Also, if I want to abort (or 'gulp' pause) the threads, I have to be creating them and not using the ThreadPool correct?
VB.NET:
ThreadPool.QueueUserWorkItem(AddressOf PullRequest)
Is there some kind of cleanup I can call to clear them faster?
Also, if I want to abort (or 'gulp' pause) the threads, I have to be creating them and not using the ThreadPool correct?