On Thu, 25 Feb 1999, Jean-Marc Lasgouttes wrote:

> >>>>> "Joacim" == Joacim Persson <[EMAIL PROTECTED]> writes:
> 
> Joacim> thus libforms manual may be wrong regarding FIFOs, but to get
> Joacim> back to what DECs man page said on select ("not necessarily
> Joacim> have data available"), I wonder if that goes for /all/ kinds
> Joacim> of file descriptors or if they just meant file descriptors for
> Joacim> /sockets/ that are available for an accept()?
> 
> To state it again:
> 
>   [Digital]  Objects ready for the requested operation are those which the
>   operation would not block and not necessarily those which have data avail-
>   able for the operation.
> 
> Objects can be anything (even streams, although I even less know what
> they are).

They also don't define `ready.' :P

> 
> Joacim> info libc, sections "I/O Overview" and down explains most of
> Joacim> the marvels of streams, pipes, and sockets.
> 
> On Digital unix? Nevermind, I think I'll look up the doc when I'll
> really need it. Currently I do not have enough free time to look at it
> seriously...

I would strongly recommend studying it.  Sockets and pipes etc are
important concepts for systems programming on any system of the unix
family.  ...there is a book that covers all of that and more in depth
including the differences between the BSD and SysV branches, but I'm damed
if I remember the title or author of it now. ...think it has a beige..ish
cover though (not a very helpful tip: that `beige' book =).

> 
> Joacim> (The bus drivers are on strike in Sweden, so I'm stuck at home
> Joacim> and have started working on my "vy"-client again -- a vi-like
> Joacim> mode for LyX using lyxserver -- as a pastime)
> 
> That's what I'd call a pervert project :)

I've entered `cw' too many times in my LyX documents now to do without
one! =)
(and I suspect a few wanton emacs-droids has gotten into even worse trouble
typing some obscure `ctrl-ð meta-shift-£' command by habit and had
LyX do strange devastating and time-consuming things by accident >:)
If it's any comfort, I'm not planning to copy vi's or vim's command set --
a plaintext programming-oriented editor's command set is not appropriate
for the task--there are a few fundamental differences between LyX and any
text editor (just look at the cursor).  I /am/ headed for the same
predicate-object based principle for the command set though, so beware.

I think we should redesign LyXfunc::dispatch a bit (regardless of my `vy'
experiment).  The current dispatch() is messy; a 2 or 3 layer approach
could be better.  One for immediate parsing of input, like dead keys or
compose-key handling or the current lyx-specific keyboard mappings.  One
for user run-time definable operations like vi's :abbr and :map (I take
it emacs et.al. have similar things -- things like math mode's macros, plus
operations that depend on the contents of the document).  And a final layer
for editing functions that only operates directly (without any magic) on
the elements in the document.  LyX is rather weak in editing functionality
as it is now, and if we introduce new lyx functions for everything,
::dispatch will grow huge and slow.

> 
> Joacim> What must have happened is: select triggered on the input pipe
> Joacim> file descriptor, but the read() claimed end-of-file (return
> Joacim> 0;); i.e. noone at the other end; broken pipe.  So why is
> Joacim> select triggering on a broken pipe?
> 
> The pipe is not broken, it is just empty... And DU considers that,
> since you can read() from this pipe, it can fire select(). 

And then read() should return -1 and set errno==EAGAIN.  It didn't; it
returned 0.  There's only two cases where ::callback resets the connection:
On end-of-file (i.e. broken pipe; read() returned 0), or if an error other
than EAGAIN occurs.  If you had a permanent error (other than EAGAIN) on
the pipe, you'd have LyX spew out error messages about it (the
"if(errno!=0)...strerror(errno)..." in ::callback). You didn't get
any, thus read() returned 0.
read() should return 0 /only/ if the pipe is down, so something is fishy
about read() on DEC I think.


Joacim
-
With both feet on the ground, you won't get very far.
                -- Loesje

Reply via email to