By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
458,122 Members | 1,559 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 458,122 IT Pros & Developers. It's quick & easy.

ASP.NET and background threads

P: n/a
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
Nov 19 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
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

"Paul Hatcher" <ph******@spamless.cix.co.uk> wrote in message
news:#8**************@TK2MSFTNGP15.phx.gbl...
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

Nov 19 '05 #2

P: n/a
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

"Ollie Riches" <ol**********@hotmail.com> wrote in message
news:#B**************@TK2MSFTNGP11.phx.gbl...
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

"Paul Hatcher" <ph******@spamless.cix.co.uk> wrote in message
news:#8**************@TK2MSFTNGP15.phx.gbl...
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


Nov 19 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.