The life and breadth of a thread is axactly as long as it is permitted to
execute. Once the end of scope is reached, the thread is unscheduled and
cleaned up by the operating system. You will have to use some sort of sleep
inside the thread or loop to keep it constantly executing. A loop is not a
good idea because it is not an efficient wait state because it burns cpu
cycles. Use a sleep inside the body of the thread. Or better yet, use a
static timer started in the global asax file. Timers are implicitly threaded
anyway and there is no management involved.
--
Regards,
Alvin Bruney [ASP.NET MVP]
Got tidbits? Get it here...
http://tinyurl.com/27cok
"Leon" <pe*******@hotmail.com> wrote in message
news:89**************************@posting.google.c om...
Is there a way I can create a thread at application level that running
all the time along with application exists?
I have tried to do the above thing, and I found for some reason, the
thread only can be excuted once after it is created.
Thanks very much for your help.