Primary Thread statistcs : Thread Creation : Thread C# Examples


C# Examples » Thread » Thread Creation »

 

Primary Thread statistcs









    
using  System;
using  System.Threading;

class  Program  {
        static  void  Main(string[]  args)  {
                Thread  primaryThread  =  Thread.CurrentThread;
                primaryThread.Name  =  "ThePrimaryThread";

                Console.WriteLine("Name  of  current  AppDomain:  {0}",  Thread.GetDomain().FriendlyName);
                Console.WriteLine("ID  of  current  Context:  {0}",  Thread.CurrentContext.ContextID);

                Console.WriteLine("Thread  Name:  {0}",  primaryThread.Name);
                Console.WriteLine("Has  thread  started?:  {0}",  primaryThread.IsAlive);
                Console.WriteLine("Priority  Level:  {0}",  primaryThread.Priority);
                Console.WriteLine("Thread  State:  {0}",  primaryThread.ThreadState);
        }
}
    
   
  
   




HTML code for linking to this page:

Follow Navioo On Twitter

C# Examples

 Navioo Thread
» Thread Creation