<div style="line-height:1.7;color:#000000;font-size:14px;font-family:Arial"><div>Steve:</div><div><br></div><div>"let the reactor event loop run and read things from the notify pipe" may be not a good idea.</div><div><br></div><div>Notify pipe has limited buffer . When put too much bytes to the write end,soon buffer will be full and write operation will be blocked.</div><div><br></div><div>As checking the current implement codes, I found that the designer may intend to keep only one message in the pipe to avoid buffer becoming full and keep plenty of messages in the queue.</div><div><br></div><div>The problem is you can purge messages in the queue but you can not easily purge messages in the pipe.</div><div><br></div><div>-Jack Wong</div><div><br></div><div><br></div><div><br></div><div style="position:relative;zoom:1"></div><div id="divNeteaseMailCard"></div><div><br></div>At 2016-11-29 00:43:07, "Steve Huston" <shuston@riverace.com> wrote:<br> <blockquote id="isReplyContent" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">




Thank you for the problem info and research into it.
<div class=""><br class="">
</div>
<div class="">The easiest way to resolve this is to let the reactor event loop run and read things from the notify pipe.</div>
<div class=""><br class="">
</div>
<div class="">-Steve</div>
<div class=""><br class="">
<div>
<blockquote type="cite" class="">
<div class="">On Nov 28, 2016, at 3:12 AM, Jack Wong <<a href="mailto:pandawkx@163.com" class="">pandawkx@163.com</a>> wrote:</div>
<br class="Apple-interchange-newline">
<div class="">
<div style="line-height: 1.7; font-size: 14px; font-family: Arial;" class="">
<div class=""><span style="font-family: arial; white-space: pre-wrap; widows: 1;" class="">ACE VERSION: 6.3.0</span></div>
<div class="">(this bug still exists in version 6.4.0)</div>
<div class=""><br class="">
</div>
<div class="">Our test codes looks like this:</div>
<div class=""><br class="">
</div>
<div class="">1:while (true)</div>
<div class="">2:{</div>
<div class="">3:    reactor()->purge_pending_notifications(xxx);</div>
<div class="">4:    reactor()->notify(xxx);</div>
<div class="">5:}</div>
<div class=""><br class="">
</div>
<div class="">after a while , we found dead-lock occurs at  line 4.</div>
<div class=""><br class="">
</div>
<div class="">гнгнгнгнгнгнгнгнгнгнгнгнгнгнгнгнгнгнгнгнгнгнгнгнгн</div>
<div class=""><br class="">
</div>
<div class="">I check the code and found that :</div>
<div class=""><br class="">
</div>
<div class="">purge_pending_notifications can only purge message in notify queue</div>
<div class=""><br class="">
</div>
<div class="">messages in pipe can not be purged</div>
<div class=""><br class="">
</div>
<div class="">so calling notify() after purge_pending_notifications() can always leads one message be write to pipe</div>
<div class=""><br class="">
</div>
<div class="">So when I keep calling like this , soon buffer of pipe will full and notify() will be blocked , then dead-lock occurs</div>
<div class=""><br class="">
</div>
<div class="">гнгнгнгнгнгнгнгнгнгнгнгнгнгнгнгнгнгнгнгнгнгнгнгнгн</div>
<div class=""><br class="">
</div>
<div class="">we are using this two interfaces building important functions of our application</div>
<div class=""><br class="">
</div>
<div class="">we will appreciate it if this bug being fixed soon</div>
<div class=""><br class="">
</div>
<div class="">гнгнгнгнгнгнгнгнгнгнгнгнгнгнгнгнгнгнгнгнгнгнгнгнгн</div>
<div class=""><br class="">
</div>
<div class="">poor English, sorry!</div>
</div>
<br class="">
<br class="">
<span title="neteasefooter" class="">
<div class=""> <br class="webkit-block-placeholder">
</div>
</span>_______________________________________________<br class="">
ace-bugs mailing list<br class="">
<a href="mailto:ace-bugs@list.isis.vanderbilt.edu" class="">ace-bugs@list.isis.vanderbilt.edu</a><br class="">
http://list.isis.vanderbilt.edu/cgi-bin/mailman/listinfo/ace-bugs</div>
</blockquote>
</div>
<br class="">
</div>


</blockquote></div><br><br><span title="neteasefooter"><p> </p></span>