BackgroundWorker From ASP.Net Application

Posted by Kevin on Stack Overflow See other posts from Stack Overflow or by Kevin
Published on 2009-11-30T18:20:50Z Indexed on 2010/04/14 10:03 UTC
Read the original article Hit count: 428

Filed under:
|
|

We have an ASP.Net application that provides administrators to work with and perform operations on large sets of records. For example, we have a "Polish Data" task that an administrator can perform to clean up data for a record (e.g. reformat phone numbers, social security numbers, etc.) When performed on a small number of records, the task completes relatively quickly. However, when a user performs the task on a larger set of records, the task may take several minutes or longer to complete. So, we want to implement these kinds of tasks using some kind of asynchronous pattern. For example, we want to be able to launch the task, and then use AJAX polling to provide a progress bar and status information.

I have been looking into using the BackgroundWorker class, but I have read some things online that make me pause. I would love to get some additional advice on this.

For example, I understand that the BackgroundWorker will actually use the thread pool from the current application. In my case, the application is an ASP.Net web site. I have read that this can be a problem because when the application recycles, the background workers will be terminated. Some of the jobs I mentioned above may take 3 minutes, but others may take a few hours.

Also, we may have several hundred administrators all performing similar operations during the day. Will the ASP.Net application thread pool be able to handle all of these background jobs efficiently while still performing it's normal request processing?

So, I am trying to determine if using the BackgroundWorker class and approach is right for our needs. Should I be looking at an alternative approach?

Thanks and sorry for such a long post!

Kevin

© Stack Overflow or respective owner

Related posts about backgroundworker

Related posts about ASP.NET