Nice approximation.
Reid
Performance Benchmarking
-
- Posts: 625
- Joined: Mon Nov 15, 2021 9:23 pm
Re: Performance Benchmarking
Cyberwerks Heavy Industries -- viewforum.php?f=76
Re: Performance Benchmarking
My understanding is that if I call Invalidate() on the canvas (e.g. when I detect a signal in ProcessSample() that means that something's changed), it'll get notified for redrawing the next time Notify() is called and I can respond to the Canvas_Painting event? I'm assuming that Notify() is getting called from some UI event loop thread quite independently of ProcessSample(), so the call to Invalidate() inside ProcessSample() doesn't result in the canvas being redrawn immediately (i.e. during the execution of ProcessSample() itself)?
Re: Performance Benchmarking
In principle yes, but the details of what's going on are obscure. Notify() isn't associated with any particular thread, instead it's like a switch nexus for multiple threads.
Tracking down what's going on in Notify() is something that I think many of us have been struggling to understand as in effect it can be being called by multiple threads "simultaneously" with no real information about thread safety mechanisms. My theory is that that Notify() doesn't have any.
I presume there is an event queue of some kind but who knows how events are actually dispatched as timers seem to be able to interrupt Notify().
To make matters worse it looks like handlers inside Notify() can possibly trigger recursive calls to Notify().
Basically simple modules work without any issues but once you start getting into multi-threading it becomes more and more mysterious.
Devising diiagnostic code to try to figure out what on earth is happening seems to be a highly evolved skill amongst more experienced VM devs.
Have fun!
Tracking down what's going on in Notify() is something that I think many of us have been struggling to understand as in effect it can be being called by multiple threads "simultaneously" with no real information about thread safety mechanisms. My theory is that that Notify() doesn't have any.
I presume there is an event queue of some kind but who knows how events are actually dispatched as timers seem to be able to interrupt Notify().
To make matters worse it looks like handlers inside Notify() can possibly trigger recursive calls to Notify().
Basically simple modules work without any issues but once you start getting into multi-threading it becomes more and more mysterious.
Devising diiagnostic code to try to figure out what on earth is happening seems to be a highly evolved skill amongst more experienced VM devs.
Have fun!