tech-kern archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Re: SIGPIPE-equivalent before writing?
Taylor R Campbell <riastradh%NetBSD.org@localhost> writes:
> - Would you use EVFILT_WRITE?
>
> Doesn't that entail a busy-wait for EV_EOF, because -- unless the
> pipe buffer is full -- the producer can often write without blocking
> while it's doing computation?
It is only a busy-wait if you loop back immediately. It would not
do exactly what you want, but a thread that slept 100 ms and checked for
writability and did shutdown if not, would be reasonably prompt with
reasonable CPU time. It is icky compared to having EVFILT_NO_WRITE or
the select equivalent.
Home |
Main Index |
Thread Index |
Old Index