0

Does Delegate.Invoke() start the method the delegate is pointed at on a new thread, or do you need to use Delegate.BeginInvoke() to do this?

Thanks

JMK
  • 27,273
  • 52
  • 163
  • 280
  • 2
    See this question http://stackoverflow.com/questions/229554/whats-the-difference-between-invoke-and-begininvoke – Rohan West Mar 20 '12 at 19:53

3 Answers3

2

Delegate.Invoke: Executes synchronously, on the same thread. Delegate.BeginInvoke: Executes asynchronously, on a threadpool thread.

from the answer here - What's the difference between Invoke() and BeginInvoke()

Community
  • 1
  • 1
DotNetUser
  • 6,494
  • 1
  • 25
  • 27
0

It runs on the same thread it is currently running, unless you do BeginInvoke

Jason
  • 3,844
  • 1
  • 21
  • 40
0

Delegate.Invoke() is just like calling the delegate, which will cause calling the delegate on the same thread. To make an async call on the delegate, you have to call it with BeginInvoke which eventually will make the call on a different thread (and then activate the Callback method)

Sofian Hnaide
  • 2,284
  • 16
  • 13