Yes, we have to be careful. ioctl(fd, I_PEEK, ...) is required for good performance. One time it broke on Linux and the performance drop was unbelievable *bad*. Sockets would only be an option if they support ioctl(fd, I_PEEK, ...), provide much larger buffers than pipes or FIFOs and allow larger atomic writes.
Olga On Fri, Apr 30, 2010 at 1:29 AM, Don Cragun <[email protected]> wrote: > On Apr 28, 2010, at 7:08 AM, Richard L. Hamilton wrote: > >> AFAIK, the BSDs implement pipe() as a special case of socketpair(), >> and thus pipes are subject to RLIMIT_SBSIZE (SB == socket buffer, I presume). >> > ... ... ... >> >> I have a shared object somewhere that I can LD_PRELOAD to >> make pipe() for the affected process call socketpair(). As I recall, I'd >> run a shell with that preset and used it for awhile, and nothing seemed >> to break. But that's not a robust test. > > I believe that some shells use ioctl(fd, I_PEEK, ...) when input is > coming from a STREAMS based pipe to avoid lots of costly single-byte > reads. > > - Don > >> >> If anyone wants it, I could post the source for that, presumably as >> an attachment, since the forums mangle directly posted source. >> >> I'd also played around with pushing bufmod onto a (for Solaris) regular >> STREAMS based pipe, but I never found a way to tell whether it made any >> difference in the behavior. I don't know without digging around if I kept >> any examples of that. >> >> Unless someone can demonstrate a performance problem with the existing >> pipe implementation, I suspect that trying to make ulimit -p settable >> on Solaris is a waste of time... > > _______________________________________________ > shell-discuss mailing list > [email protected] > http://mail.opensolaris.org/mailman/listinfo/shell-discuss > -- , _ _ , { \/`o;====- Olga Kryzhanovska -====;o`\/ } .----'-/`-/ [email protected] \-`\-'----. `'-..-| / Solaris/BSD//C/C++ programmer \ |-..-'` /\/\ /\/\ `--` `--` _______________________________________________ shell-discuss mailing list [email protected] http://mail.opensolaris.org/mailman/listinfo/shell-discuss
