Subject: Re: signal(SIGSEGV, SIG_IGN) -> 100% CPU
To: Gandhi woulda smacked you <email@example.com>
From: Todd Vierling <firstname.lastname@example.org>
Date: 06/14/1999 17:04:45
On Mon, 14 Jun 1999, Gandhi woulda smacked you wrote:
: # Yeah. Which would mean that pipe(3) would take three syscalls instead
: # of the one it presently takes. Whether this would matter, of course,
: # is another issue.
: I think it would matter since 3 system calls = at least 6 context switches.
Read My Lips: One System Call. <g>
If we claim to support two-way pipe() (which Solaris already does, so I'd
assume others do too without ill effects!), we may just:
return socketpair(PF_LOCAL, SOCK_STREAM, 0, fds);
This in libc, of course, not the kernel. The usual behavior of one side of
a pipe() fd closing (causes SIGPIPE on read or write) also happens with a
closed-ended socket. So, the behavior is /close to/ identical for
unidirectional data transfer.
-- Todd Vierling (Personal email@example.com; Bus. firstname.lastname@example.org)