Control.Invoke

  • Thread starter Thread starter Cool Guy
  • Start date Start date
C

Cool Guy

If I call Control.Invoke on a worker thread, which thread gets blocked: the
worker thread or the main (GUI) thread?
 
Hi,

The thread owning the hwnd belonging to the control instance (I your case
the main GUI thread) will execute the delegate, the calling worker thread
will "block" pending the return of the call to Invoke, which returns when
the delegate returns. Of course in the case of BeginInvoke the calling
thread does not block, BeginInvoke returns immediately and the worker
threads continues

Hope this helps
 
Back
Top