<will...@25thandclement.com> wrote:
> On Sat, May 02, 2009 at 09:33:14PM -0700, Dan Kegel wrote:
>> Fwiw, with edge-triggered mode, you don't need to do any such futzing.
>
> How's that?

With edge-triggered mode, your app is sent notifications only
when the readiness state of an fd *changes*.  That means
you never have to tell the OS when your interest mask
changes, as you manage that yourself in userspace.
It saves a fair number of syscalls.  This doesn't matter
unless you're trying to really get close to hardware
performance.  It's also kind of a large rethink for most
folks used to select() or poll(); your app's state machine
has to handle readiness notifications without fail
in edge-triggered mode.  If your state machine isn't airtight,
connections will seem to hang.
But for me it was worth the extra effort in programming,
and after I got used to it, it was simpler than the traditional
way.

Not all OS's support edge-triggered mode, but IIRC
Linux, BSD, and Solaris do.

I haven't tried it with libevent yet, but I hear tell that 2.0 has
support for it.
- Dan
_______________________________________________
Libevent-users mailing list
Libevent-users@monkey.org
http://monkeymail.org/mailman/listinfo/libevent-users

Reply via email to