E
Elisa
Hi,
I already asked something similar previously, but I still haven't
completely grasped the concept of threads and events.
I'm trying to design an app using the Observer pattern and the Command
pattern, e.g. my GUI adds commands to a queue, this queue process these
commands in a seperate thread, and notifies any listeners (read: the
GUI) of state changes, progress, etc.
Thus, a rather classical approach, but...
The interaction between threads and events confuses me, and the VB .NET
documentation sadly doesn't say a word about how events behave with
multiple threads :-(
I now that if I want to change the GUI directly from outside the GUI's
main thread, I need to use Control.Invoke().
But does that also apply if I fire events (using RaiseEvent)? I.e.
because the notifications (read: events) are fired from the queue's
processing thread, does this mean that the code inside my listeners
(read: event handlers) must use Control.Invoke() to update the GUI?
Regards,
Elisa
I already asked something similar previously, but I still haven't
completely grasped the concept of threads and events.
I'm trying to design an app using the Observer pattern and the Command
pattern, e.g. my GUI adds commands to a queue, this queue process these
commands in a seperate thread, and notifies any listeners (read: the
GUI) of state changes, progress, etc.
Thus, a rather classical approach, but...
The interaction between threads and events confuses me, and the VB .NET
documentation sadly doesn't say a word about how events behave with
multiple threads :-(
I now that if I want to change the GUI directly from outside the GUI's
main thread, I need to use Control.Invoke().
But does that also apply if I fire events (using RaiseEvent)? I.e.
because the notifications (read: events) are fired from the queue's
processing thread, does this mean that the code inside my listeners
(read: event handlers) must use Control.Invoke() to update the GUI?
Regards,
Elisa