Threadpool question!

D

DBC User

I was trying to do a batch process, where I have all the requests in a
table. I need to scan the table and for each entry I need to run a
thread (since it is long running process). This table get added
dynamically while this batch process is running. So I am trying to
findout the optimal way to use threadpool to achive this.

I have looked at couple of examples on the web and all of them takes
all the requests and queue them up. There is no logic in there to do
what I am trying to do. Is it possible to do this with Threadpool? Any
link or suggestion greatly appriciated.
Thanks.
 
N

Nicholas Paldino [.NET/C# MVP]

Instead of storing the rows in a table, why not take the information and
pass the row information to the thread pool? This way, each thread in the
pool has its own information to work on, and you don't have to worry about
new rows.

Hope this helps.
 
D

DBC User

Thanks Nicholas, Only reason I am storing the data is for historic
purposes to show it to the client.
Nicholas said:
Instead of storing the rows in a table, why not take the information and
pass the row information to the thread pool? This way, each thread in the
pool has its own information to work on, and you don't have to worry about
new rows.

Hope this helps.


--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

DBC User said:
I was trying to do a batch process, where I have all the requests in a
table. I need to scan the table and for each entry I need to run a
thread (since it is long running process). This table get added
dynamically while this batch process is running. So I am trying to
findout the optimal way to use threadpool to achive this.

I have looked at couple of examples on the web and all of them takes
all the requests and queue them up. There is no logic in there to do
what I am trying to do. Is it possible to do this with Threadpool? Any
link or suggestion greatly appriciated.
Thanks.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top