ASP.NET and background threads

P

Paul Hatcher

I have an ASP.NET application that uses a background threads to perform a
long-running process. What I'm not sure is how to track and communicate with
the thread.

The site is divided up into sections, each of which could have it's own
background process. Given that any user should be able to inquire against
the current status of a process thread, I don't know how to keep a reference
to it unless I just put it into Global.asax, which seems a bit tacky.

On a similar problem, I can't see how to retreive status information from
the background process; I can give it an interface etc, but given that the
page that needs the info is nothing to do with the page that initiated the
action I can't see where to put the hooks.

Regards

Paul
 
O

Ollie Riches

Ideally you don't want to do a long running task inside the asp.net process
using a background thread, why? because it will compete with the both iis &
asp.net for system resources and therefore give you a less scalable and less
responsive system. Rather you should thinking about moving the long running
task out-of-process from the asp.net process so that it is executed
asynchronously, message queues (MQ) are very suitable for this solution. As
for status information that will depend on how you implement the solution
but you will probably end up writing status information to a data repository
(database) so that it can be queried by any interested party.

HTH

Ollie Riches
 
P

Paul Hatcher

You're right - that would probably solve one of my major problems at the
moment, the ASP.NET process being recycled and therefore terminating the
background process.

Ok, time to read-up on invoking MSMQ from .NET :)

Thanks

Paul
 

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

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top