[GRASS5] Tk <-> C
Radim Blazek
blazek at itc.it
Wed Sep 25 06:50:48 EDT 2002
On Wednesday 25 September 2002 05:55 am, Glynn Clements wrote:
...
> IOW, the OGSF drawing functions repeatedly call back to the "update"
> function, which probably explains why the interface doesn't freeze.
"update" is exactly what I was looking for, thanks.
> However, unless the authors of both NVIZ and OGSF have been very
> careful, attempting to actually use the interface while drawing is in
> progress may have undesirable consequences.
>
> The difficulty in writing "multi-threaded" code isn't in implementing
> the multi-threading, but ensuring that the code allows for the
> consequences.
I don't think that new thread is created ("Tcl lets you have one or more Tcl
interpreters. However, each interpreter is tightly bound to its OS thread").
If GS_check_cancel() is called
-> Cxl_func -> CancelFunc_Hook -> TkCopyAndGlobalEval()
it should wait until TkCopyAndGlobalEval() ends. But because
it calls "update", "DRAW" button can start 'new' Nsurf_draw_all
while 'old' is still running.
So it is not clear to me where and how the 'old' Nsurf_draw_all
is killed.
Radim
More information about the grass-dev
mailing list