Jeff Janes <jeff(dot)janes(at)gmail(dot)com> writes:
> On Sat, Aug 10, 2013 at 4:26 AM, Greg Stark <stark(at)mit(dot)edu> wrote:
>> The problem is that I don't know of any way to detect eof on a socket
>> other than trying to read from it (or calling poll or select).
> Do we know how inefficient it is, compared to the baseline work done
> by CHECK_FOR_INTERRUPTS() and its affiliated machinery?
CHECK_FOR_INTERRUPTS() is about two instructions (test a global variable
and branch) in the normal case with nothing to do. Don't even think of
putting a kernel call into it.
regards, tom lane