Saturday, February 4, 2012

How a thread is created ?


First, create a new Thread Start delegate. The delegate points to a method that will be executed by the new thread. Pass this delegate as a parameter when creating a new Thread instance. Finally, call the Thread.Start method to run your method.


In Detail :


1. Create a System.Threading.Thread object.
2. Create the call back function
3. Starting the Thread




Thread newThread= new Thread(new ThreadStart (MyCallbackFunction));


                 /  \                                                      /  \
                   |         (1)                                            |          (2)




newThread.Start()


        /  \
          |        (3)











No comments:

Post a Comment

Thank you for Commenting Will reply soon ......

Featured Posts

#Linux Commands Unveiled: #date, #uname, #hostname, #hostid, #arch, #nproc

 #Linux Commands Unveiled: #date, #uname, #hostname, #hostid, #arch, #nproc Linux is an open-source operating system that is loved by millio...