J
Jon Pope
I've got a basic question about threading which I'm hoping someone here will
be able to answer:
Let's say my calling CallingClass has instantiated and started a worker
thread. When my worker thread has completed, it fires an event which
CallingClass has an event handler listening for.
My question is this: in which thread is that event handler operating? The
worker's or CallingClass's? The issue I'm running into is that if I include
a Worker.Join() call within the event handler on CallingClass, it just sits
there forever waiting for the worker thread to stop.
Is this even the proper to signal the end of a thread? I have some
processing that is waiting for the thread is completely finish and shutdown,
and I need a way to find that out. Any help someone can provide would be
greatly appreciated.
Cheers, Jon
be able to answer:
Let's say my calling CallingClass has instantiated and started a worker
thread. When my worker thread has completed, it fires an event which
CallingClass has an event handler listening for.
My question is this: in which thread is that event handler operating? The
worker's or CallingClass's? The issue I'm running into is that if I include
a Worker.Join() call within the event handler on CallingClass, it just sits
there forever waiting for the worker thread to stop.
Is this even the proper to signal the end of a thread? I have some
processing that is waiting for the thread is completely finish and shutdown,
and I need a way to find that out. Any help someone can provide would be
greatly appreciated.
Cheers, Jon