This is the mail archive of the kawa@sourceware.cygnus.com mailing list for the Kawa project. See the Kawa home page for more information.


[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index] [Subject Index] [Author Index] [Thread Index]

Re: Why GuiConsole hangs



Per Bothner wrote:
> 
> ... I implemented the ideas from Jacl,
> and it seems to work [see below] - except for one problem:
> It does not handle end-of-file properly.  If I type a ^D at
> the beginning of a line, the stream is not available()
> until I type an <Enter>.  And then the stream is available,
> Kawa wakes up, exits, and the <Enter> is passed on to the Shell.
> 
> So I guess the question is whether Jacl manages to correctly
> handle EOF, or is this unsolvable?

Jacl has the same problem:

$ jacl
% ^Dhello
$ hello
bash: hello: command not found
$ 


> 
> So I gues the question is which is a bigger problem:
> (a) can't fix GUI with reading from System.in
> (b) can't recohmize eof from System.in properly.
> 
> If we can't fix both, which is more important?
> My current inclination is that (a) is more important to fix.

It's not just GUIs.  If you put a System.out.println("Started");
in the run() method of Future you'll see that NO threads will
execute while you're at the prompt.

>From memory it goes something like:

#|kawa|# (define x (future (sleep 5)))
#|kawa|# x
<future...>
#|kawa|# ; sit here as long as you like, nothing happens
#|kawa|# (sleep 0.01)
!!! New Thread Started !!!

Given this, I'd say (a) is VASTLY more important.

imw