[zeromq-dev] Edge-triggered polling vs Level-triggered. Which one ZMQ is using? Why?
Michel Pelletier
pelletier.michel at gmail.com
Mon Jul 14 17:42:14 CEST 2014
There are some discussions here:
http://lwn.net/Articles/25137/
http://www.kegel.com/c10k.html
A quick scan of nanomsg source indicates it can use epoll, kqueue, or poll.
The first two are edge-triggered and the third is level-triggered.
nanomsg appears in the first two cases to keep an internal array of events
(self->events) to emulate level triggering (I could be wrong about that as
I am not a nanomsg dev).
As for one vs the other, I think it's a non-issue. Neither one is right or
wrong, correct code can be written for either case. If you are doing
event-driven programming you are either already aware of the issues of the
underlying api (epoll/kqueue/poll) or will have to come to understand them
eventually.
-Michel
On Mon, Jul 14, 2014 at 4:52 AM, artemv zmq <artemv.zmq at gmail.com> wrote:
> Hi Pieter
>
> Not sure if it is related or not, but I experience an issue with using
> ZMQ.Poller and java socket (SelectableChannel). I.e. poller api itself
> allows me to register SelectableChannel on poller (for POLLIN),
> but combination isn't workable -- poller does render presence of incoming
> traffic only once.. ((
>
>
> 2014-07-14 14:31 GMT+03:00 Pieter Hintjens <ph at imatix.com>:
>
> This was a design decision from very long ago, 2009 or so, and there
>> was no real discussion of it. I've always assumed if it was really a
>> problem in libzmq, someone would have changed that by now.
>>
>> On Mon, Jul 14, 2014 at 11:50 AM, artemv zmq <artemv.zmq at gmail.com>
>> wrote:
>> > Hi community
>> >
>> > Did read nanomsg' docs, the part where they have been explaining
>> differences
>> > against zmq. They mentioned that they use level-triggered polling
>> instead of
>> > edge-triggered one as it's in zmq.
>> > Since I'm not expert in this low-level stuff, but I'm still very
>> curious why
>> > zeromq decided to go edge-triggered way instead of level-triggered one.
>> >
>> > Thanks in advance.
>> >
>> >
>> > --
>> > artemv
>> >
>> > _______________________________________________
>> > zeromq-dev mailing list
>> > zeromq-dev at lists.zeromq.org
>> > http://lists.zeromq.org/mailman/listinfo/zeromq-dev
>> >
>> _______________________________________________
>> zeromq-dev mailing list
>> zeromq-dev at lists.zeromq.org
>> http://lists.zeromq.org/mailman/listinfo/zeromq-dev
>>
>
>
> _______________________________________________
> zeromq-dev mailing list
> zeromq-dev at lists.zeromq.org
> http://lists.zeromq.org/mailman/listinfo/zeromq-dev
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.zeromq.org/pipermail/zeromq-dev/attachments/20140714/6e868c0e/attachment.htm>
More information about the zeromq-dev
mailing list