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