[zeromq-dev] epoll spurious events

Ilja Golshtein ilejncs at narod.ru
Tue May 14 14:11:12 CEST 2013


Hello, list.

I've wrote fairly simple program to
check if 0mq socket is usable with external
eventloop
http://pastebin.com/St0DJ4jX

We have main thread runs epoll
for socketpair handle and for a 0mq socket.
Another thread ('buzzer') writes something 
via 0mq and via socketpair.

I would expect that epoll fires once for
socketpait and once for 0mq socket,
while in reality I can see that 0mq shows
some activity three times
==
$ ./zmq_epoll 
hello from buzzer
fd=16, j=0 zmq events: EPOLLIN 
sent something via 0mq
fd=16, j=0 zmq events: EPOLLIN 
0mq:zmq
sent something via socketpair
fd=13, j=0 socketpair events: EPOLLIN 
socket_pair:something
fd=16, j=0 zmq events: EPOLLIN 
timeout
timeout
timeout
timeout
timeout
timeout
==

May be I am doing something wrong?

The assumption that two 'extra' events caused
by connect and close seems wrong
(at least not all 'extra' events are always caused
by connect/close things).

My concern is such spurious events
are harmful from performance point of view.

Explanation (or link to such explanation) of what is going under the hood
is appreciated.

-- 
Best regards
Ilja Golshtein



More information about the zeromq-dev mailing list