Threading in ASP.NET

W

walterd

Hi

I have searched the net and all multi-threading examples are for Windows
Forms.
I have multiple long running processes, some run for more than four hours.
I start them simultaneously as they can run in parallel. I want to be able
to stop them
when I want to. I create threads for each as I don't want the page to
freeze.
Is there a way that I can keep track of each thread and be able to kill it
when I want to?
ThreadPool don't give me that possibility, and because it's a web page,
every postback re-initialise the class.

Your help is highly appreciated.
 
S

Sean M

Having read the ASP.NET Performance article from patterns and
practices[1], I would strongly recommend against using manually-created
threads from within classes derived from Page. There's just too much of a
performance hit involved.

Is there any possibility your long-running processes could be
implemented as a web service that the page could call? Perhaps queued for a
separate Windows Service that runs in the background? This would avoid any
icky interactions with the thread pool that the ASP.NET worker process uses.

[1] http://msdn.microsoft.com/library/en-us/dnpag/html/scalenetcheck03.asp

Cheers,

Sean M
 

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,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top