run-time settting of PIPE_BUF

John R. Miller john at crcaus.cactus.org
Wed Jun 12 16:30:22 AEST 1991


In article <1991Jun10.185820.8120 at rice.edu> zdenko at katzo.rice.edu (zdenko tomasic) writes:
>Does anybody know how to change the pipe buffer PIPE_BUF?

It can't be changed.

>... I suspect
>that it has a value of 512 bytes (POSIX conformance?),

nope

>... but according
>to /usr/include/sys/limits.h, it can be increased to 32KB at
>run-time. I was not able to find out from info how to achieve that.

It's always 32k.  You can demonstrate this by doing a blocking write of
32k to a pipe that has one byte in it already.  The write will block
because AIX guarantees it will deliver writes of less than 32k
atomically, but it can't because there isn't enough room in the pipe. 
If the pipe is empty the write will succeed, because there is enough
room to write it all at once.  If the write is larger than 32k the write
will succeed but it won't be delivered to the pipe (and thus readers)
atomically.  Atomic writes aren't guaranteed for writes larger than 32k.

>Default pipe behavior in AIX is rather inefficient with too many
>context switches.

If you are seeing too many context switches, I don't think it's caused
by pipe buffers filling up.

disclaimer: I've been wrong before.

-- 
John R. Miller   13102 Briar Hollow Dr.   Austin, Texas  78729
hm: 512/331-0155 john at crcaus.cactus.org  or ..cs.utexas.edu!bigtex!crcaus!john
wk: 512/823-3867 john at glasnost.austin.ibm.com



More information about the Comp.unix.aix mailing list