is this possible?

  • Thread starter Thread starter Arran Pearce
  • Start date Start date
A

Arran Pearce

Not sure if what i want to do will work.



If i start a new thread in the Application_Start event is there a risk that
that thread will be forced to stop? If no user uses my site for a while
(all session's time out) i understand the application stops until another
user comes to the site. if my thread is doing something will it be forced
to stop or will the Application stop after the thread is done.


What i am thinking of doing is populating a Search Catalogue when the
application starts. Is this feasible?
 
But what about that poor, poor sucker who is unlucky enough to hit your site
and kick off that process!!?

It would probably be better to have a batch process run in the background
(perhaps as a service) that keeps the search catalogue up to date, since
that is something that's easier/faster to "maintain", rather than "catch up"
whenever a user hits your site?
 
Hi,

Frank is right. just for the discussion the thread will be terminate if
the application stop or the application will wait for the thread to stop
depends on IsBackground property of the thread and if the thread is part
of the aspnet_process or web aplication appDomain. If the thread is
background it will be terminate when the process terminate if not the
process won’t terminate until the thread terminate. But the interesting
stuff is if the thread associated with appDomain of the web application
or with aspnet_wp process. If the thread maintained by the aspnet_wp
then it won’t terminate until the process terminate, regardless to the
web application state.

Natty Gur, CTO
Dao2Com Ltd.
34th Elkalay st. Raanana
Israel , 43000
Phone Numbers:
Office: +972-(0)9-7740261
Fax: +972-(0)9-7740261
Mobile: +972-(0)58-888377
 
thanks for the info.

Yeah thought it might be a bit dodgy. I will probably just write a windows
service or something to do it.

cheers

Arran
 
Back
Top