[prev in list] [next in list] [prev in thread] [next in thread] 

List:       zeromq-dev
Subject:    Re: [zeromq-dev] Hint/Example to use zmq socket in an asynchronous
From:       Steven McCoy <steven.mccoy () miru ! hk>
Date:       2010-01-27 12:41:27
Message-ID: 7f8a97b61001270441g2041bd9cq4e2e6ae9b28113c9 () mail ! gmail ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


2010/1/22 Martin Sustrik <sustrik@250bpm.com>

> Jianhua Cao wrote:
> > Isn't zmq_poll the zmq centric way in the sense that the even loop has
> > to be built with zmq_poll to block?
> > I am thinking to integrate zmq (played as client role) to an existing
> > async web frame work like tornado.
> > One way I was thinking is to extract fd from zmq socket object. But that
> > seems to be a wrong approach.
>
> The problem is that a single 0MQ socket can handle thousands of
> connections, each with its own fd. Moreover the polling logic is more
> complex than just checking whether there's anything to read from the
> socket (think of message queueing, message filtering etc.) Thus
> "extracting the fd" approach won't work.
>
> It certainly would be nice to have non-0MQ-centric way to do polling,
> like using 0MQ socket handles directly by select/poll/epoll functions,
> unfortunately, POSIX doesn't define any hook-up point for polling.
>
> Yes, eventfd is getting close, but it's Linux-specific and it still
> lacks ability to signal bot IN and OUT simultaneously.
>
>
As evidence you can look at how OpenPGM notifications occur, it's a smaller
controlled environment compared with the scope of ZeroMQ.  It has the
requirements to signal incoming and outgoing ready events from it's state
and rate control engines and this has to be implemented using a set of
pipes, socketpairs, or eventfds.  It ends up complicated, and can easily
escalate in complexity when you want to choose between level and edge based
event generation.

-- 
Steve-o

[Attachment #5 (text/html)]

2010/1/22 Martin Sustrik <span dir="ltr">&lt;<a \
href="mailto:sustrik@250bpm.com">sustrik@250bpm.com</a>&gt;</span><br><div \
class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 \
.8ex;border-left:1px #ccc solid;padding-left:1ex;">

Jianhua Cao wrote:<br>
&gt; Isn&#39;t zmq_poll the zmq centric way in the sense that the even loop has<br>
&gt; to be built with zmq_poll to block?<br>
&gt; I am thinking to integrate zmq (played as client role) to an existing<br>
&gt; async web frame work like tornado.<br>
&gt; One way I was thinking is to extract fd from zmq socket object. But that<br>
&gt; seems to be a wrong approach.<br>
<br>
The problem is that a single 0MQ socket can handle thousands of<br>
connections, each with its own fd. Moreover the polling logic is more<br>
complex than just checking whether there&#39;s anything to read from the<br>
socket (think of message queueing, message filtering etc.) Thus<br>
&quot;extracting the fd&quot; approach won&#39;t work.<br>
<br>
It certainly would be nice to have non-0MQ-centric way to do polling,<br>
like using 0MQ socket handles directly by select/poll/epoll functions,<br>
unfortunately, POSIX doesn&#39;t define any hook-up point for polling.<br>
<br>
Yes, eventfd is getting close, but it&#39;s Linux-specific and it still<br>
lacks ability to signal bot IN and OUT simultaneously.<br>
<div><div></div><div class="h5"><br></div></div></blockquote><div><br></div><div>As \
evidence you can look at how OpenPGM notifications occur, it&#39;s a smaller \
controlled environment compared with the scope of ZeroMQ.  It has the requirements to \
signal incoming and outgoing ready events from it&#39;s state and rate control \
engines and this has to be implemented using a set of pipes, socketpairs, or \
eventfds.  It ends up complicated, and can easily escalate in complexity when you \
want to choose between level and edge based event generation.</div>

<div><br></div><div>-- </div><div>Steve-o </div></div>



_______________________________________________
zeromq-dev mailing list
zeromq-dev@lists.zeromq.org
http://lists.zeromq.org/mailman/listinfo/zeromq-dev


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic