Robert Half Technology
 Search
Wednesday, December 03, 2008 ..:: Community Forum ::.. Register  Login
 Community Forum Minimize
     
  .NET Development  MCTS 70-536 Study Group  difference between two different ways to start a Thread  

 difference between two different ways to start a Thread 
 
Flip
72 posts
difference between two different ways to start a Thread
Posted: 07 Mar 07 12:19 PM (Canada)
 
In playing with Threads in the past, I noticed something funky in the book about starting a Thread and requiring the ThreadStart, the book talks about this (off the top of my head so it could be slightly wrong, but the jist is there :>).

Thread t = new Thread(new ThreadStart(DoHeavyLiftingHere));

vs

Thread t = new Thread(DoHeavyLiftingHere);

I've done it the latter way in the past figuring that's just the way to do it, but the book contradicts this claim. hhhmmmmmm WTF? I just saw an article in the MS forums talking about this exact thing, and my way is a shortcut (figures! :>) to the first way.

http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=1316836&SiteID=1

The jist of doing it the former way over the latter is if you think you might change to a ParameterizedThreadStart, you'll need to revisit all the calling methods to rejig them.
 
   .NET Development  MCTS 70-536 Study Group  difference between two different ways to start a Thread
 
 
   

Search   

Copyright 2008 Ottawa .NET Community   Terms Of Use  Privacy Statement
Portal engine source code is copyright 2002-2008 by DotNetNuke. All Rights Reserved