[lkml]   [2001]   [Sep]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: [PATCH] /dev/epoll update ...
"Christopher K. St. John" wrote:
> Ok, just to confirm. Using the language of BSD's
> kqueue[1]. you've got:
> a) report the event only once when it occurs aka
> "edge triggered" (EV_CLEAR, not EV_ONESHOT)
> b) continuously report the event as long as the
> state is valid, aka "level triggered"

Right, and kqueue() can't even represent the 'level triggered' style --
or at least it isn't clear from the paper that it can! True "level triggered"
would require that the kernel track readiness of the affected file descriptors.

> The Banga99 paper certainly appears to describe an
> "edge triggered" interface:
> "Our new API follows the event-based approach. In
> this model the kernel simply reports a stream of
> events to the application. ... The kernel does
> not track the readiness of any descriptor ... "
> Libenzi-/dev/epoll, being a partical implementation
> of the Banga99 mechanism, is also edge-triggered.
> OTOH, the Provos/Lever Linux /dev/poll paper describes
> what appears to be a "level triggered" interface.


> Now for a question: My initial impression was that
> Solaris-/dev/poll, in contrast to Linux /dev/poll, was
> edge-triggered. That would explain why it might be
> more efficient that Linux-/dev/poll.
> But I don't have a copy of Solaris, handy, so I
> can't confirm. Do you know for sure? (Or is part of
> my analysis wrong?)

Solaris /dev/poll is definitely level-triggered; see in, which verifies this. is a thin wrapper around /dev/poll, and it definitely exhibits
level-triggered behavior with both Solaris and Linux /dev/poll.

(I later extended Poller to support edge-triggered notifications from the OS,
and translate them to level-triggered notification for the user app. and are somewhat fatter wrappers around O_ASYNC,
and achieve level-triggered behavior only with cooperation from the application,
which has to call clearReadiness(fd) when the OS returns EWOULDBLOCK!
Surely the OS could do that internally, eh?)

Java's Selector in JDK 1.4 will have level-triggered behavior, not
edge-triggered behavior, btw.
- Dan
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

 \ /
  Last update: 2005-03-22 13:03    [W:0.084 / U:0.080 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site