Pipe buffering query

Stephen K. Uitti suitti at pur-phy.UUCP
Thu Dec 1 05:16:35 AEST 1983


 Given I set up the pipe with "a | b" is there any way for
 the standard output of "a" to become immediately available
 on the standard input of "b"?

	Rather than unbuffer the stdio, as was suggested, use fflush() on
the pipe when done with a line or message.  If only one character is to
be processed at a time, maybe unbuffered I/O is what is needed.  You will
find that unbuffered I/O is SLOW.  You do a painful system call for each
character.  The UN*X kernel really would rather that you send a buch of
characters at a time.  "fflush" flushes the buffer & waits until the data
is written.  It should be documented in chapter 3 of the manuals, which
we call "c-callable subroutines".

Stephen Uitti (Purdue physics site manager)
UUCP:		pur-ee!Physics:suitti, purdue!Physics:suitti
INTERNET:	suitti @ pur-phy.UUCP



More information about the Comp.unix.wizards mailing list