What's the difference for Thread Pool and Thread?

  • Thread starter Thread starter sleepyant
  • Start date Start date
S

sleepyant

Hi, I have an application that will download something from a remote server
which might take a long time while downloading. To enable my form to be
'responsive' and able to push a 'Cancel' button on the main form to
terminate the download, I decided to use thread.

After a few research, I find that there are actually different ways to do
threading. The biggest doubt is what's the difference between Thread Pooling
and create another Thread? What kind of method is most suitable for my
current application?

Please advice. Thanks.
 
The threadpool is typically suitable for short running work items. That
being said, the real limitation is that it is a application-wide limited
resource (25 per CPU), there are a lot of internal classes that use the
threadpoool, so if you perform a lot of long running tasks you will use up
all the threads.

I'd use a manual thread for your longrunning task. Make sure to set it's
background property to true.
 
Back
Top