ARTICLE

Steps involved in Thread lifecycle

Posted by Shinuraj Articles | C# Language April 12, 2011
Steps involved in Thread lifecycle
Reader Level:

Here is the different steps involved in creating a new thread to run a thread.

Step 1: writes a class with some methods.
 
        Class TestingThread
        {
             Public static void SendMail()
             { 
               //Write the code to send mail
             }
        }

Step 2: Write  a ThreadStart delegate and point the address of SendMail. 

ThreadStart ts=new ThreadStart(TestingThread.SendMail()) 

Step 3: Create a thread

Thread t=new Thread(ts); 

Step 4: finally start the Threads.

t.Start();

Login to add your contents and source code to this article
post comment
     

Shinuraj, above article taken from "http://www.roseindia.net/java/thread/life-cycle-of-threads.shtml"? Are both these articles belongs to you?

Posted by Suthish Nair Apr 13, 2011

Good article

Posted by Dinesh Beniwal Apr 13, 2011
COMMENT USING
PREMIUM SPONSORS
DynamicPDF™ product line allows you to dynamically generate PDF documents, merge PDF documents and add new content to existing PDF documents from within your applications.
SPONSORED BY
  • PDF reports have never been easier to create. With our included WYSIWYG Designer, you can layout your reports, set up your data source and let DynamicPDF ReportWriter do the rest.