Path: utzoo!utgpu!watmath!uunet!mcvax!hp4nl!ruuinf!piet From: piet@ruuinf (Piet van Oostrum) Newsgroups: gnu.emacs Subject: Re: PROCESS-SEND-REGION problems Message-ID: <1146@ruuinf.UUCP> Date: 21 Feb 89 13:15:44 GMT References: <8902152055.AA00224@othello.LCL.CMU.EDU> Sender: piet@ruuinf.UUCP Reply-To: piet@ruuinf (Piet van Oostrum) Distribution: gnu Organization: Dept of Computer Science, University of Utrecht, Holland Lines: 26 In-reply-to: eno@OTHELLO.LCL.CMU.EDU (Ben Fine) 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)