473,394 Members | 1,870 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

ASP.NET and background threads

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
2 4709
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: patty | last post by:
I have created a simple C# application which instantiates an object of a class I defined and calls a single method on the class. When I run the application in the debugger, I see there are 3...
1
by: Ahsan | last post by:
I have created some background threads so that when the application aborts all the threads should be automatically aborted. But the problem is that when I make a thread background thread I am...
0
by: Gomaw Beoyr | last post by:
Hello The book "C# Black Book" chapter about Threads says that a "background thread" cannot communicate directly with a visual element, e.g. a label, and thus has to use the BeginInvoke method,...
13
by: orekin | last post by:
Hi There I have been programming C# for a couple of months and am trying to master Threading. I understand that ThreadPool uses background threads (see code example in MSDN page titled...
4
by: Senthil | last post by:
Hi.. Can anyone tell how to find the threads(name or ID) running in the background using C#. I want to find those threads and to terminate if needed. Thanks, Palani.
1
by: Ioannis Vranos | last post by:
In .NET, what happens when a background thread and a foreground thread have the same priority (e.g. Normal). Do they share the same processor time? -- Ioannis Vranos
8
by: Analizer1 | last post by:
From what im reading about backgroundworker thread it seems it can only have 1 thread at a time is this correct tks
7
by: csharpula csharp | last post by:
Hello, I got a question regarding the usage of background worker. How can I run few threads via background worker with different objects as parameter each time. I understood that I can't do...
1
by: not_a_commie | last post by:
I have a background thread running in my application. When my application loses focus there is a 200 to 500ms delay in the execution of my background thread. Is this normal? Setting the process and...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.