Listing 1: Chello World Threading Application using System; using System.Threading; //Include the threading // library. namespace BasicThreading { /// /// Demonstrates the basic usage of a thread. /// class ThreadHello { static void ThreadDelegate() //Delegate for your // thread object. { Console.WriteLine("Chello there sparky... :)"); Console.ReadLine(); //Just wait for key input. } [STAThread] static void Main(string[] args) { //First get an instance to the thread and pass // your delegate. Thread myThread = new Thread(new ThreadStart(ThreadDelegate)); //Give the thread a name - really helpful for debugging. myThread.Name = "My Chello Thread"; //Set the thread priority - but only if you //can't live with normal priority. myThread.Priority = ThreadPriority.AboveNormal; //Remember to start the thread. myThread.Start(); //Uncomment these lines to play with suspending //and resuming threads and getting their state. //Console.WriteLine(myThread.ThreadState.ToString()); //myThread.Suspend(); //Console.WriteLine(myThread.ThreadState.ToString()); //myThread.Resume(); //Console.WriteLine(myThread.ThreadState.ToString()); } } } Listing 2: IL Code for Chello World Threading Application .method private hidebysig static void Main(string[] args) cil managed { .entrypoint .custom instance void [mscorlib]System.STAThreadAttribute::.ctor() = ( 01 00 00 00 ) // Code size 43 (0x2b) .maxstack 3 .locals init ([0] class [mscorlib]System.Threading.Thread myThread) IL_0000: ldnull IL_0001: ldftn void BasicThreading.ThreadHello::ThreadDelegate() IL_0007: newobj instance void [mscorlib]System.Threading.ThreadStart::.ctor (object, native int) IL_000c: newobj instance void [mscorlib]System.Threading.Thread::.ctor(class [mscorlib]System.Threading.ThreadStart) IL_0011: stloc.0 IL_0012: ldloc.0 IL_0013: ldstr "My Chello Thread" IL_0018: callvirt instance void [mscorlib]System.Threading.Thread::set_Name(string) IL_001d: ldloc.0 IL_001e: ldc.i4.3 IL_001f: callvirt instance void [mscorlib]System.Threading.Thread::set_Priority(valuetype [mscorlib]System.Threading.ThreadPriority) IL_0024: ldloc.0 IL_0025: callvirt instance void [mscorlib]System.Threading.Thread::Start() IL_002a: ret } // end of method ThreadHello::Main