Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. Thread Question

Thread Question

Scheduled Pinned Locked Moved ASP.NET
question
3 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • W Offline
    W Offline
    Wingnut74
    wrote on last edited by
    #1

    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?

    T S 2 Replies Last reply
    0
    • W Wingnut74

      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?

      T Offline
      T Offline
      Tim Kohler
      wrote on last edited by
      #2

      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

      1 Reply Last reply
      0
      • W Wingnut74

        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?

        S Offline
        S Offline
        Serge Lobko Lobanovsky
        wrote on last edited by
        #3

        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)

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups