Thread Question
-
Is it possible to spin off a thread in the Application_Start of the global.asax that will go into a loop and do work off of stuff it finds in the Application cache? Basically, I want it to check for some items, sleep for a few seconds and do it again... etc. Am I off my gord or is this obvious and I am just an idiot?
-
Is it possible to spin off a thread in the Application_Start of the global.asax that will go into a loop and do work off of stuff it finds in the Application cache? Basically, I want it to check for some items, sleep for a few seconds and do it again... etc. Am I off my gord or is this obvious and I am just an idiot?
I don't see a problem with doing that just off the top of my head. Another thing you might want to look at is setting timers on values in the application cache. I can't remember the syntax but it basically involves you passing a delegate and a timespan in when you set the value in the app cache. Your delegate will get called when the time elapses. Just another way that might work for you. Tim
-
Is it possible to spin off a thread in the Application_Start of the global.asax that will go into a loop and do work off of stuff it finds in the Application cache? Basically, I want it to check for some items, sleep for a few seconds and do it again... etc. Am I off my gord or is this obvious and I am just an idiot?
Hi, Have you tried to launch a new thread in an ASPX page? Actually, I've tried it, and it gave me unpredictable results. I was sending 20 different e-mails in a new thread launched from an ASPX page, and sometimes i got 14 identical letters, or 6 different ones, or whatever. Seems that all threads started in the scope of the ASPX page are killed when the page has been sent to the client. However, I don't know if that applies to a thread started in Application_Start. Regards, Serge (Logic Software, Easy Projects .NET site)