Threadpool question!

  • Thread starter Thread starter DBC User
  • Start date Start date
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.
 
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.
 
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.
 
Back
Top