<br><div>The "select()" in PHP's spread-extension still does not make sense to me yet.<br><br>I'm using spread's C++ interface.<br></div><div>&nbsp;</div><div style="padding: 2px 0pt; font-size: 12px; font-family: Arial Narrow;">------------------&nbsp;原始邮件&nbsp;------------------</div><div style="font-size: 12px;"><div id="menu_sender"><b>发件人:</b>&nbsp;"Alexey Zakhlestin"&lt;indeyets@gmail.com&gt;;</div><div><b>发送时间:</b>&nbsp;2008年11月5日(星期三) 晚上7:23</div><div><b>收件人:</b>&nbsp;"lzhshen"&lt;29585543@qq.com&gt;; </div><div><b>抄送:</b>&nbsp;"spread-users"&lt;spread-users@lists.spread.org&gt;; </div><div><b>主题:</b>&nbsp;Re: [Spread-users] Is there any elegant way to make application to regain CPU from being blocked in receive() ?</div></div><div>&nbsp;</div>
<div style="font-weight: normal;">
2008/11/4 lzhshen &lt;29585543@qq.com&gt;:<br>&gt; FYI, sender sets an alarm (10 secs) before calling receive() for ACK event.<br>&gt; If there is<br>&gt; no ACK event in 10 secs, sender will receive a SIG_ALARM signal and signal<br>&gt; handler<br>&gt;&nbsp; will be invoked. In the signal handler, sender uses siglongjmp() to jump<br>&gt; back to<br>&gt;&nbsp; resend event logic.<br>&gt;<br>&gt; Is there any problem with this logic? Doe siglongjmp make sender fail to<br>&gt; receive ACK<br>&gt;&nbsp; event even after the receiver become alive?<br>&gt;<br>&gt; Is there any more elegant way to make sender to regain CPU from being<br>&gt; blocked in<br>&gt; receive() if there is no ACK event in a centain period of time?<br><br>PHP's spread-extension uses select() call to check if there is any<br>data on socket, and uses timeout parameter of select() to wait for<br>timeout.<br>Check sources here:<br>http://cvs.php.net/viewvc.cgi/pecl/spread/php_spread.c?view=markup&amp;pathrev=MAIN<br><br>search for "select("<br><br><br>&gt; Thanks in advance!<br>&gt;<br>&gt; ------------------ 原始邮件 ------------------<br>&gt; 发件人: "Alexey Zakhlestin"&lt;indeyets@gmail.com&gt;;<br>&gt; 发送时间: 2008年10月23日(星期四) 凌晨0:28<br>&gt; 收件人: "lzhshen"&lt;29585543@qq.com&gt;;<br>&gt; 抄送: "spread-users"&lt;spread-users@lists.spread.org&gt;;<br>&gt; 主题: Re: [Spread-users] how does Spread make sure that the event is<br>&gt; successfully delivered to the subscriber?<br>&gt;<br>&gt; On Wed, Oct 22, 2008 at 12:58 PM, lzhshen &lt;29585543@qq.com&gt; wrote:<br>&gt;&gt;&nbsp;&nbsp;&nbsp;&nbsp; When the event publisher sends the event to Spread and the subscriber<br>&gt;&gt; lose the connection with Spread, will this event be lost forever? Will<br>&gt;&gt; Spread sends the same event to the subscriber when it connects to Spread<br>&gt;&gt; again?<br>&gt;<br>&gt; it won't.<br>&gt; this kind of logic is supposed to be implemented on application-level.<br>&gt;<br>&gt; think of spreas as of "UDP". if you need to verify delievery, you have<br>&gt; to implement "TCP" on top of it<br>&gt;<br>&gt; --<br>&gt; Alexey Zakhlestin<br>&gt; http://blog.milkfarmsoft.com/<br><br><br><br>-- <br>Alexey Zakhlestin<br>http://blog.milkfarmsoft.com/<br></div>