[gnu.emacs] PROCESS-SEND-REGION problems

eno@OTHELLO.LCL.CMU.EDU (Ben Fine) (02/16/89)

When I send a process a large region with PROCESS-SEND-REGION, my Emacs dies.

I'm running GNU Emacs 18.52.1 on an HP 9000/350 under HP-UX 6.01.  I'm using
X11R3 and the Korn Shell (if that matters).

Please help.  I belive I have a Constitutional Right to talk to Common Lisp.

Replies to: bf08+@andrew.cmu.edu

--Ben Fine 

piet@ruuinf (Piet van Oostrum) (02/21/89)

In article <8902152055.AA00224@othello.LCL.CMU.EDU>, eno@OTHELLO (Ben Fine) writes:
 `When I send a process a large region with PROCESS-SEND-REGION, my Emacs dies.
 `
 `I'm running GNU Emacs 18.52.1 on an HP 9000/350 under HP-UX 6.01.  I'm using
 `X11R3 and the Korn Shell (if that matters).
 `
This is a problem that I have had a number of times. The problem is in the
buffering that goes with pipes (and pty's). What happens is that you get a
deadlock because 
  1) You are piping a large message into a subprocess. The subprocess must
     empty the pipe (or pty) to enable emacs to continue.
  2) The subprocess is (presumably) returning data through another pipe.
     Now if this pipe fills, the subprocess gets blocked until emacs
     empties the pipe. But emacs doesn't because it is waiting for the
     subprocess to drain its input pipe.
This is a no-win situation, unless you can convince emacs to process the
output once in a while before the total of input+output gets to large. So
you can try to give the subprocess small pieces of input in a loop and
process the input that comes out in between.

I think that the emacs manual should give a warning for these problems.
Hopefully GNU will not be this braindamaged.
-- 
Piet van Oostrum, Dept of Computer Science, University of Utrecht
Padualaan 14, P.O. Box 80.089, 3508 TB Utrecht, The Netherlands
Telephone: +31-30-531806. piet@cs.ruu.nl (mcvax!hp4nl!ruuinf!piet)