<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=us-ascii">
<TITLE>Message</TITLE>

<META content="MSHTML 6.00.6000.16481" name=GENERATOR></HEAD>
<BODY>
<DIV><SPAN class=170540816-27072007><FONT face=Arial color=#0000ff size=2>Hi 
Hal,</FONT></SPAN></DIV>
<DIV><SPAN class=170540816-27072007><FONT face=Arial color=#0000ff 
size=2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=170540816-27072007><FONT face=Arial color=#0000ff size=2>Thanks 
for the feedback - I've edited the comments in TP_Reactor.h to more accurately 
reflect this situation - thanks very much for bringing that 
up.</FONT></SPAN></DIV>
<DIV><FONT face=Arial color=#0000ff size=2></FONT>&nbsp;</DIV>
<DIV><SPAN class=170540816-27072007><FONT face=Arial color=#0000ff 
size=2>-Steve</FONT></SPAN></DIV><!-- Converted from text/plain format -->
<P><FONT size=2>--<BR>Steve Huston, Riverace Corporation<BR>Would you like ACE 
to run great on your platform?<BR>See <A 
href="http://www.riverace.com/sponsor.htm">http://www.riverace.com/sponsor.htm</A><BR></FONT></P>
<BLOCKQUOTE dir=ltr 
style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #0000ff 2px solid; MARGIN-RIGHT: 0px">
  <DIV></DIV>
  <DIV class=OutlookMessageHeader lang=en-us dir=ltr align=left><FONT 
  face=Tahoma size=2>-----Original Message-----<BR><B>From:</B> 
  ace-bugs-bounces@cse.wustl.edu [mailto:ace-bugs-bounces@cse.wustl.edu] <B>On 
  Behalf Of </B>Hal Black<BR><B>Sent:</B> Friday, July 27, 2007 12:18 
  AM<BR><B>To:</B> ace-bugs@cse.wustl.edu<BR><B>Subject:</B> Re: [ace-bugs] 
  [ACE_TP_Reactor]: [Event_Handler suspensionnothonoredfor 
  handle_close]<BR><BR></FONT></DIV>Thanks Doug, Johnny, and Steve all for your 
  quick replies.<BR><BR>
  <DIV><SPAN class=gmail_quote>On 7/26/07, <B class=gmail_sendername>Steve 
  Huston</B> &lt;<A 
  href="mailto:shuston@riverace.com">shuston@riverace.com</A>&gt; wrote: </SPAN>
  <BLOCKQUOTE class=gmail_quote 
  style="PADDING-LEFT: 1ex; MARGIN: 0pt 0pt 0pt 0.8ex; BORDER-LEFT: rgb(204,204,204) 1px solid">Hi 
    folks,<BR><BR>As Doug and Johnny indicated, there were some important 
    improvements <BR>to ACE_TP_Reactor a few betas ago, and 5.5.9 may resolve 
    this. But I<BR>want to clarify a question Hal 
    asked:<BR><BR>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; As I understand it, 
    the ACE_TP_Reactor is supposed to<BR>&gt; suspend events<BR>&gt; on an event 
    handler that is being called by another thread <BR>&gt; until that 
    call<BR>&gt; returns.&nbsp;&nbsp;So what's going on here?&nbsp;&nbsp;Is this 
    a mistaken<BR>&gt; interpretation by me?<BR><BR>Yes, a common one... 
    ACE_TP_Reactor suspends the handler around _I/O_<BR>callbacks, but not 
    around notifies or timers. Since you're using <BR>notify(), the suspension 
    around your handle_input() callback is<BR>ineffective.</BLOCKQUOTE>
  <DIV><BR>Ahh, so that's why it looked like it didn't suspend notifies, timers, 
  etc when I was reading through the ACE_TP_Reactor source code.&nbsp; I just 
  couldn't fathom how the ACE_TP_Reactor would be useful at all without the 
  locking: there would be no safe way for general purpose event handlers being 
  called by the TP Reactor to self destruct (which is very widely used with 
  ACE_Event_Handlers).&nbsp; You guys do such a great and thorough job, I just 
  assumed I was missing something.&nbsp; 8') <BR><BR>The reference-counted event 
  handler sounds like it will solve that problem, though.&nbsp; I really should 
  go through the back issues of the Riverace newsletters, 
  huh?<BR></DIV><BR>Changing this comment from ACE_TP_Reactor.h might make this 
  misconception a bit less common, still: <BR><BR>&nbsp;*&nbsp; [...] Note that 
  callback code in<BR>&nbsp;* Event Handlers (e.g. Event_Handler::handle_input) 
  does not have to<BR>&nbsp;* be modified or made thread-safe for this 
  Reactor.&nbsp; This is because<BR>&nbsp;* an activated Event Handler is 
  suspended in the Reactor before the <BR>&nbsp;* upcall is made and resumed 
  after the upcall completes.&nbsp; Therefore,<BR>&nbsp;* one Event Handler 
  cannot be called by multiple threads<BR>&nbsp;* simultaneously.<BR><BR><BR>
  <BLOCKQUOTE class=gmail_quote 
  style="PADDING-LEFT: 1ex; MARGIN: 0pt 0pt 0pt 0.8ex; BORDER-LEFT: rgb(204,204,204) 1px solid">&gt; 
    Is there a known bug in this version?&nbsp;&nbsp;Or is something 
    else<BR>&gt; entirely going on?<BR><BR>You may also want to investigate 
    using reference-counted event<BR>handlers, which would prevent deletion of 
    the handler while there's a <BR>notify() queued, or any timer or I/O 
    registrations still in effect.<BR>This is covered in the October 2005 
    edition<BR>(<A 
    href="http://www.riverace.com/newsletters/October2005.htm">http://www.riverace.com/newsletters/October2005.htm 
    </A>) of the Riverace<BR>ACE News and Tips newsletter.</BLOCKQUOTE>
  <DIV><BR>Great tip.&nbsp; Is ACE_Svc_Handler::handle_close() is safe to 
  call?&nbsp; That is, does it know about the reference counting and therefore 
  won't self destruct and mess up the reference counting scheme? 
  <BR></DIV><BR></DIV></BLOCKQUOTE></BODY></HTML>