"Stirling" <St******@discussions.microsoft.com> wrote in message
news:60**********************************@microsof t.com...
I have a main worker thread that spawns a child thread to do some
listening. What I would like to have happen is to have the child thread raise events
in the parent thread, and have the parent thread respond to those events.
Is it possible to have one thread raise events in another thread? So far
I have not been able to do so. Each thread seems to only be able to raise
it's own events.
Are you sure that it's necessary that the event be handled on the parent's
thread? It's probably OK to let the event be handed on the child thread.
You just have to watch out for UI control access and sync issues. It
depends on what you are really needing to do.
One other problem you will have with the queue technique is that the child
thread can pump those messages in pretty fast. The way I describe is
naturally throttled because the child thread can't raise another event until
the earlier event handler finishes. YMMV.
-- Alan