Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com From: "Ross Boulet" To: Subject: RE: limiting strace?, was: failure of unzip and recent cygwin1.dll Date: Wed, 18 Feb 2004 16:10:07 -0600 Message-ID: <003101c3f66b$fd315c70$6401a8c0@RossLap> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" In-Reply-To: X-IsSubscribed: yes Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by delorie.com id i1IMD8eW022954 > On Wed, 18 Feb 2004, Ross Boulet wrote: > > > > On Wed, 18 Feb 2004, Ross Boulet wrote: > > > [...snip...] > > Ok, time for "Pipes 101". A pipe is essentially a bounded (character) > buffer. The producer application fills the buffer (by writing to the > pipe), and the consumer application empties it (by reading > from the pipe). > If the buffer is full, the producer application blocks > (inside the write) > until room is available. If there's no data to read, the consumer > application blocks. The amount of pipe data stored in memory is > determined only by the size of the buffer. For unbuffered pipes, the > amount is 1 character. > > Once the data is read from the buffer, its further fate is up to the > consumer application. Some applications (like grep) act as > filters, and > require only enough memory for the current line. Some (like > sort) will > read the whole input and store it in memory before processing > it (or use > temporary files internally, but these have nothing to do with the pipe > itself). If you're interested in the behavior of any particular > application, I suggest you look at the sources of the corresponding > package (available for *all* Cygwin packages). > Igor > P.S. FYI, less doesn't necessarily read all of the input, and > has options > limiting the amount of allocated memory. Thanks for the enlightenment Igor, I looked at the options for less and see what you mean. The -b and -B options can be used to limit how much memory less consumes. A couple more questions - you mentioned buffered and unbuffered pipes. What determines whether the pipe is buffered or unbuffered? Is cygwin managing its own pipes, or passing them off to Windoze to manage? Thanks, Ross -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/