Control.Invoke

C

Cool Guy

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

Chris Taylor

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top