E
emma_middlebrook
Hi
Advice needed about what's the best in the following situation.
In essence, I have a GUI that needs to detail time taken to do jobs
that execute in their own thread.
Currently, the GUI thread instantiates a class that wraps a job,
handing it a callback (delegate) to call once the job has finished. On
callback, always on a different thread than the GUI thread,
InvokeRequired is tested (and is always true), and the GUI is updated
via Invoke.
Is this standard and best? Or do people out there do something
different? I'm just concerned about the GUI class having to do a
thread-related test. It seems out of place: it shouldn't have to know
that other threads are involved so is there some kind of standard way
to hide this away?
Thanks and any help appreciated!
Emma.
Advice needed about what's the best in the following situation.
In essence, I have a GUI that needs to detail time taken to do jobs
that execute in their own thread.
Currently, the GUI thread instantiates a class that wraps a job,
handing it a callback (delegate) to call once the job has finished. On
callback, always on a different thread than the GUI thread,
InvokeRequired is tested (and is always true), and the GUI is updated
via Invoke.
Is this standard and best? Or do people out there do something
different? I'm just concerned about the GUI class having to do a
thread-related test. It seems out of place: it shouldn't have to know
that other threads are involved so is there some kind of standard way
to hide this away?
Thanks and any help appreciated!
Emma.