use of Threadstart delegate

Posted by krrishbiju-15589 under C# on 1/26/2015 | Points: 10 | Views : 395 | Status : [Member] | Replies : 1
Please resolve this,

For thread initialization what is the difference of using "Threadstart" and without using "Threadstart".

1. Thread worker = new Thread(new ThreadStart(DoTimeConsumingWork));
worker.Start();

2. Thread worker = new Thread(DoTimeConsumingWork);
worker.Start();

Both are working.
What is the difference between two.

Regards
krrish




Responses

Posted by: Jitendrasoft09 on: 2/1/2015 [Member] [MVP] Starter | Points: 25

Up
0
Down
Hi,

ThreadStart starts a new thread and Thread starts to run in same thread without calling constructor.
Please refer below link for more details-

http://www.dotnetperls.com/threadstart

Jitendra Kumar
If my post helps you, plz mark as an answer.

krrishbiju-15589, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response