[GRASS5] Tk <-> C

Glynn Clements glynn.clements at virgin.net
Wed Sep 25 07:30:39 EDT 2002


Radim Blazek wrote:

> > 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").

There's a reason why I put quotes around "multi-threaded". It isn't
multi-threaded in the sense of actual OS threads, but the behaviour is
very much the same: a "command" can be executed before the previous
one has finished.

> 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.

It wasn't clear to me WHETHER the 'old' Nsurf_draw_all is killed. That
was what I meant about "being very careful".

-- 
Glynn Clements <glynn.clements at virgin.net>




More information about the grass-dev mailing list