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
  • 2,996
  • 3
  • 26
  • 49
psj01
  • 2,723
  • 5
  • 25
  • 56

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
  • 24,810
  • 2
  • 29
  • 38