On Wednesday, July 25, 2018 at 11:32:17 AM UTC-7,
sled...@gmail.com wrote:
> Aside from the women using this group who are just dying to meet me ...
>
> Question: does it take less time and resources to use events or 'tracing' the change of a variable to handle an event.
>
> Background:
>
> Have a speech rec app that employs TCOM to interface with MS SAPI. SAPI posts a recognition event, which, in turn is managed by a tcl event bound to a window as a result of an event generate command.
>
> Tried to use uevent, but Komodo throws up even while editing.
>
> BTW: Speech rec is exceedingly response-time sensitive. As an aside, most often, it is only a 500ms pause that indicates to you that the other person has stopped speaking.
>
> But I digress...
>
> So the thought occurred - put trace on a variable that is modified when TCOM passes back the SAPI recognition event. Seems that is a lot less 'work' in terms of setup and execution.
>
> Perspectives on this are most welcomed.
You have to understand the difference between the two approaches. The trace will fire and execute the callback immediately when the variable is set. The [set] command cannot complete until the callback is done, thus blocking other event activity. (and don't even think about calling [update] in a trace callback.)
Using events allows for the event loop to determine what should be handled and when, hopefully giving better overall behavior.
>
> And 'Yes', I am asking this before time is spent developing a test suite and timings.
Most likely the only way to know what works best is to do the testing and timings.
-Brian