[zeromq-dev] best practice

Matt Connolly matt.connolly at me.com
Thu Dec 12 00:24:33 CET 2013


On 12 Dec 2013, at 12:43 am, Pieter Hintjens <ph at imatix.com> wrote:

> On Wed, Dec 11, 2013 at 1:40 PM, Andrew Hume <andrew at research.att.com> wrote:
> 
>> i’ve just switched to using poller and wanted to verify my “pattern”.
>> i have 4 incoming sockets. 3 are (very) low volume but need low latency
>> the other socket is high volume where (almost) any latency will do.
>> 
>> my pattern is to initialize the poller with the high volume socket last,
>> but when i get a hit on that socket, i read up to 100 messages before
>> going back to polling.
>> 
>> is there a better way to do this?
> 
> Sounds right. The order that you register sockets won't be significant
> IMO (worth measuring). On all systems (but OS/X specifically), you
> will win by doing non-blocking reads until there are no messages left,
> and only then switch to polling.


Does this mean that the readable state on a poller might not be updated if there are other sockets in the poll set that are already readable (have messages in queue)?

-Matt


More information about the zeromq-dev mailing list