tkwait variable problems

Peter J M Polkinghorne (Peter.Polkinghorne@gec-hrc.co.uk)
Wed, 11 Oct 1995 16:13:51 +0100

May be I am completely misunderstanding how Tk event loops work, but I am
having major problems with tkwait variable on tk4.0/tcl7.4 (with patch 1,
but not yet 2, applied) on a SunOs4.1.3 cc environment. The other possible
factor is using scotty/tkined extensions (hence copy to mailing list).

The situation is that I have a pipe opened to a process. I send commands to the
process & proces the output. Because of the nature of the process, output
is not guaranteed. So I set up:
a) a fileevent handler on the file waiting for readable.
b) an after timeout handler.

Both these handlers set a global variable on execution.

My program having kicked off these handlers then does a tkwait variable
on the global variable. The idea being that either some output should
arrive or the timeout should happen.

However what does happen is that after a while of runing successfully, things
stop, or rather the tkwait seems to wait forever. An additional complication
that comes from the tkined side of things, is that code that interogates the
pipe is also run as an event handler. Could things get too deeply nested
or just forgotten?

There seems no way to find out what event handlers are active which would give
me a clearer picture of what is or is not happening.

I guess if there is no immediate answer to this, I could try coding up a
simplified demo example.

--
Peter Polkinghorne,               Email: pjmp@gec-rl-hrc.co.uk
GEC Hirst Research Centre,
Elstree Way, Borehamwood,  "World is crazier and more of it than we think,
Herts. WD6 1RX ENGLAND     Incorrigibly plural" - Snow - Louis Macneice.