Erik Mandke
Erik Mandke

Reputation: 1667

ASP.net running Thread class Foreground-Threads

I do have a quick question regarding extra foreground threads that are running in an ASP.net Web Application. I let some things run in an extra Thread class thread like Cleanup-Actions after a certain event, but the user is not interested in those operations, therefore the threads - these operations should just run ( rather in the background ) and have nothing to do with serving requests.

I know that it would be a better approach by using separate programms for jobs like this.. Windows Service for example, but I "inherited" that code by former employees..

Upvotes: 3

Views: 148

Answers (1)

usr
usr

Reputation: 171178

Any work being done or queued inside ASP.NET can be lost at any time. It is not necessary to answer your questions in detail because they are moot. There are many reasons the whole process can just go away.

Windows Services also can go away at any time (crash, blue screen, ...).

If you need reliable execution you need to persist the work. Some kind of message queue (could be a database table) is appropriate.

Upvotes: 1

Related Questions