Subject: Re: FIONWRITE proposal
To: Bill Studenmund <wrstuden@netbsd.org>
From: David Brownlee <abs@NetBSD.org>
List: tech-kern
Date: 10/19/2004 22:11:09
On Tue, 19 Oct 2004, Bill Studenmund wrote:

> On Tue, Oct 19, 2004 at 09:07:37AM +0100, David Brownlee wrote:
>> 	I may be missing something here, but what is wrong with
>> 	setting SO_SNDLOWAT on the socket and then using poll() or
>> 	select()?
>
> The fact that the application isn't written as one large event loop. It's
> a multi-threaded app. Since the work is done in the threads, to move to
> anything where poll() (well kevent()) would be useful would mean adding
> more thread context switches. We'd have to hand the transmission off from
> the thread generating data to the one doing the poll, then had control
> back to the worker thread when it's done.

 	The suggested ioctl() would allows a check for sufficent
 	write space on a socket. At first glance the same could be
 	done by polling with poll(). What does the ioctl() give
 	you that a poll() on that one fd with instant timeout
 	doesn't, other than slightly less overhead setup?

-- 
 		David/absolute       -- www.NetBSD.org: No hype required --