G
Gary Short
Hello group,
I'm writing a spidering app and I'd appreciate some advice on
threading. My plan of attack is to have a main thread fetching the
html from a list of urls in a xml file, then spawning a new thread
using ThreadPool.QueueUserWorkItem(new WaitCallback(threadFunction));
to do the actual indexing in an asynchronous manner.
My understanding is that this method will cause the function to be
queued for execution by the next available ThreadPool thread. Now my
question is, can I just keep calling this method ad infinitum without
having any adverse effect on resources, this all being handled by the
ThreadPool, or is there a maximum number of threads I should be
spawning?
Thanks in advance,
Gary
I'm writing a spidering app and I'd appreciate some advice on
threading. My plan of attack is to have a main thread fetching the
html from a list of urls in a xml file, then spawning a new thread
using ThreadPool.QueueUserWorkItem(new WaitCallback(threadFunction));
to do the actual indexing in an asynchronous manner.
My understanding is that this method will cause the function to be
queued for execution by the next available ThreadPool thread. Now my
question is, can I just keep calling this method ad infinitum without
having any adverse effect on resources, this all being handled by the
ThreadPool, or is there a maximum number of threads I should be
spawning?
Thanks in advance,
Gary