Threadpool design question

Posted by ZeroVector on Stack Overflow See other posts from Stack Overflow or by ZeroVector
Published on 2010-06-14T15:44:17Z Indexed on 2010/06/14 16:02 UTC
Read the original article Hit count: 205

Filed under:
|
|

I have a design question. I want some feedback to know if a ThreadPool is appropriate for the client program I am writing.

I am having a client running as a service processing database records. Each of these records contains connection information to external FTP sites [basically it is a queue of files to transfer]. A lot of them are to the same host, just moving different files. Therefore, I am grouping them together by host. I want to be able to create a new thread per host. I really don't care when the transfers finish, they just need to do all the work (or try to do) they were assigned, and then terminate once they are finished, cleaning up all resources they used in the process.

I anticipate no more than 10-25 connections to be established. Once the transfer queue is empty, the program will simply wait until there are records in the queue again.

Is the ThreadPool a good candidate for this or should I use a different approach?

Edit: For the most part, this is the only significant custom application running on the server.

© Stack Overflow or respective owner

Related posts about c#

Related posts about threading