[MonoTouch] InvokeOnMainThread vs BeginInvokeOnMainThread: Confused by the wiki

David Moles davidmoles at thegogame.com
Thu Dec 2 13:15:35 EST 2010

The wiki <http://wiki.monotouch.net/HowTo/Threading> says:

BeginInvokeOnMainThread will suspend the execution of your thread, and wait
for the delegate to be executed on the main thread. When that completes, the
thread resumes execution. Additionally, it is possible to use
InvokeOnMainThread() to queue a delegate for invocation, but this will
suspend your thread until the main thread had a change to run.

This seems to say that both InvokeOnMainThread and
BeginInvokeOnMainThreadwill block until after the main thread's run
the delegate. I assume one of
them just queues it without blocking, but which?

(What I'm actually trying to do is, *from* the main thread, queue something
that will run on the main thread *later*, after the current event finishes
processing. Possible?)

(As an ex-Java programmer, of course what I'm really looking for is
EventQueue.invokeLater(). :))

David Moles
davidmoles at thegogame.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/monotouch/attachments/20101202/cb2f37a8/attachment.html 

More information about the MonoTouch mailing list