| Description: |
As of:
Tcl checkout 616933386027adb3068427bb2b8d4f9c381b773b (core-8-6-10-rc)
Tk checkout 2646185c928ae0bddf92005696fe85c26a565271 (core-8-6-10-rc)
I am seeing a different behavior with "after idle". It builds past, "after idle" would activate a script almost immediately, if the application was not busy. Now scripts do not fire off until the GUI records another Tk event.
The symptoms were originally reported in ticket [db27f845e86ff85895f1f1586641928993dffc75], as a failure of the canvas to update in the background.
After further analysis, I have found the real problem is a signaling mechanism between my simulator and the GUI. When the simulator completes a type step, it passes a message to the GUI which is essentially:
oo::class create MyGiantGUI {
method signal args {
variable events
if {"redraw" in $args} {
after cancel $events(redraw)
set events(redraw) [after idle [namespace code {my UpdateGui}]]
}
}
}
Invoking the signal method with the argument with the appropriate pattern tells the GUI to schedule a redraw. As this can happen multiple times, or as a different event may have scheduled a redraw to happen later in he future, we make sure that cancel any previously scheduled event.
Now that scripts fail to fire off until Tk answers some other event, it looks like our program has stopped working. Until the user clicks on the canvas or waves their mouse in front of it.
|
| User Comments: |
marc_culler (claiming to be Marc Culler) added on 2019-11-18 16:37:27:
Does this happen on all platforms, or only on macOS? (I think the previous
report was only for macOS). I am awaiting a promised ticket for something that
sounded similar to this on the Mac.
I have a suspicion about this. Can you please try the attached patch which
reverts some changes to the setupProc. The changes asked the Mac window
manager to provide a "heartbeat" event every 0.1 second. I am wondering if
that prevents Tcl from being idle when it is doing a lot of work which is
unrelated to the UI. (It also prevents 10 or 15 test failures which arise
when vwaits time out.)
In a different direction, I have noticed the following warnings when building Tcl:
tclMacOSXNotify.c:111:8: warning: 'OSSpinLock' is deprecated: first deprecated in macOS 10.12 - Use os_unfair_lock() from <os/lock.h> instead [-Wdeprecated-declarations]
static OSSpinLock notifierLock = SPINLOCK_INIT;
I doubt that is related, but might be worth checking out.
|