Return to Snippet

Revision: 53632
at November 30, 2011 06:18 by rengber


Initial Code
static void Main(string[] args)
        {
            Thread t = new Thread(SleepyTime);
            t.Start(); 

            Console.ReadKey();         
        }

        static void SleepyTime()
        {
            Thread.Sleep(10000); 
        }

Initial URL
http://www.albahari.com/threading/

Initial Description
Saw some strange console app behavior while hosting quartz.net had to doublecheck that a console app will not exit while background threads are running.  In the example below, once the main method ends, the app stays alive for 10 seconds while the background thread finishes.

Initial Title
Simplest Possible Background Thread and Console App Lifetime Test

Initial Tags


Initial Language
C#