Nice work! Re: EXPERIMENTAL: tevent_kqueue support
idra at samba.org
Wed Mar 6 13:02:32 MST 2013
On 03/06/2013 02:57 PM, Jeremy Allison wrote:
> On Wed, Mar 06, 2013 at 10:47:05AM -0500, Ira Cooper wrote:
>> On Wed, Mar 6, 2013 at 10:18 AM, Stefan (metze) Metzmacher <metze at samba.org>
>> Solaris/illumos has /dev/poll, correct?
>> I haven't looked into details, but that should provide the same
>> as poll(),
>> which means the kernel reports POLLIN and POLLOUT together.
>> In re-reading the doc, for port_associate, I think you are right. It'll do
>> that. But it will only give 1 event per fd.
> We should be able to build a tevent backend on top of port_create()/
> port_associate()/port_getn() and friends.
> The only tricky bit I see is re-adding the fd events that have
> fired back (as port_getn() "helpfully" removes them once they've
> triggered :-).
> Same for kqueue I think.
Shouldn't be too difficult you just need an inner wrapping for
tevent_fd_add and friends so that the callbacks goes first through an
internal callback that readds the fd once the event has been dealt with
by the 'real' callback and unless it has been modified by the callback
\-> internal callback
| \-> real callback
More information about the samba-technical