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

Spawning thread from ASP.NET (how safe?)

P: n/a
Hi,

How safe it is to spawn a thread to do some routine job
from Application_Start event of ASP.NET

Also whenever the ASPNET worker process restarts, will the
Application_Start event be fired??

Thanks in advance,
Sanjay Kedare
Nov 18 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
I'm not sure I understand what you mean by safety. Threads work the way the
always do. There is no inherent safety issues. Now depending on whether the
thread is a foreground thread or a background thread it could still run
while the browser is closed for example.

Spawning a thread in application_start will create a global thread.
Everytime application_start runs, your thread will run which shouldn't be
that frequent. You can have global threads, like I have done, to monitor the
application itself, check memory pressure, housekeeping type stuff really.
I'd suggest a timer instead of a thread if you need that thread to work off
a set schedule.

--
Regards,
Alvin Bruney
Got Tidbits? Get it here
www.networkip.net/tidbits
"Sanjay Kedare" <sa***********@yahoo.com> wrote in message
news:00****************************@phx.gbl...
Hi,

How safe it is to spawn a thread to do some routine job
from Application_Start event of ASP.NET

Also whenever the ASPNET worker process restarts, will the
Application_Start event be fired??

Thanks in advance,
Sanjay Kedare

Nov 18 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.