3

What is the difference between...

Thread MyThread = new Thread(ChangeColor);

vs.

Thread MyThread = new Thread(new ThreadStart(ChangeColor));

Both are starting a new thread but is there a difference between doing it one way vs. the other?

steve cook
  • 3,116
  • 3
  • 30
  • 51
psj01
  • 3,075
  • 6
  • 32
  • 63

1 Answers1

4

Nothing. You're effectively asking the difference between:

ThreadStart threadStart = ChangeColor;

and

ThreadStart threadStart = new ThreadStart(ChangeColor);

The first is an implicit method group conversion. Both result in the same compiled code.

Charles Mager
  • 25,735
  • 2
  • 35
  • 45