What is difference between Invoke and Begin Invoke

Author Topic: What is difference between Invoke and Begin Invoke  (Read 313 times)

Offline beingchinmayTopic starter

  • Trade Count: (0)
  • Jr. Member
  • **
  • Thank You 1
  • Posts: 73
  • Karma: 0
  • Gender: Male
  • I am Chinmay
    • Fat Cutter
  • Delegate.Invoke: Executes synchronously, on the same thread.
    Delegate.BeginInvoke: Executes asynchronously, on a threadpool thread.
    Control.Invoke: Executes on the UI thread, but calling thread waits for completion before continuing.
    Control.BeginInvoke: Executes on the UI thread, and calling thread doesn't wait for completion.
    BeginInvoke is asynchronous. When BeginInvoke is called from the UI thread the request will be executed
    in parallel with the UI thread. Which means it may not execute until after the currently executing method
    has returned. So in this case the text box will never appear to update because the for loop will not be interrupted, as the calling thread will not wait for this event to be completed before continuing


 

Related Topics

  Subject / Started by Replies Last post
22 Replies
10857 Views
Last post 12-04-2016, 23:34:48
by annarichart
34 Replies
17747 Views
Last post 03-25-2014, 06:13:10
by parijatziw
4 Replies
1757 Views
Last post 11-28-2012, 00:13:19
by DavisJoseph
5 Replies
5395 Views
Last post 04-19-2016, 00:25:36
by TomClarke
1 Replies
901 Views
Last post 08-23-2016, 02:14:38
by TomClarke