<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>Also, in order to make such an important change to the core of
ACE, we do need an automated regression test that reproduces the problem. This
must be written like the ACE regression tests under ACE_wrappers/tests. If
someone can make this test and add it to bugzilla, the issue gets higher in the
todo list, without such a test we have to write one, which consumes more time.<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>Johnny, I didn&#8217;t mean any offense. You do confirm my observation
with the statement: &#8220;people don't have time anymore to just fix these kind of
issues without funding&#8221;. I am sorry that this is the case, as I really like
ACE. &nbsp;But I strongly feel that &nbsp;if there is not anyone who feels
enough sense of ownership to fix clear bugs like this one, then it is hard to
justify using ACE in any project which doesn&#8217;t allocate specific funding for
ACE maintenance.<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>Now again that&#8217;s fine with me, and I certainly don&#8217;t ask anyone
to provide a service for free. However in the light of my own experience
(serious bug fixed in 2002, reintroduced in 2003 and still there in 2008), I
tend to disagree with the statement in ACE&#8217;s overview: &#8220;</span>ACE continues to
improve and its <a href="http://www.cs.wustl.edu/%7Eschmidt/ACE-future.html">future</a>
is bright&#8221;.<span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>Please read docs/ACE-bug-process.html, the issue is more that
people don't have time anymore to just fix these kind of issues without
funding. This is a change in the core of ACE which has to be investigated,
reviewed, tested, all taking time. At the moment someone is willing to fund
such a change there are multiple people that would be willing to work on this.
We as Remedy IT do fix issues on the doc_group release without funding, but our
budgets for doing that are limited, at the end we also have to pay our bills.<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>Rudy, I reported the exact same issue and diagnostic a couple of
months ago (see mailing list on 11/29/2007 and 11/30/2007). Even though this is
a clear bug, it seemed to me that there was no one in particular planning to
fix the code. I ended up patching my own version, moving the notify() in the
code below one line down after the closing brace, so it would be out of the
scope of the ACE_GUARD. This fixes the issue and &nbsp;I have not seen any
termination race conditions.<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Arial","sans-serif";
color:blue'>I have had a closer look at all related bug messages and now I see
that my <br>
problem is already quite old (sorry for that).</span><o:p></o:p></p>

<div>

<p class=MsoNormal>&nbsp;<o:p></o:p></p>

</div>

<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Arial","sans-serif";
color:blue'>Correct me if I'm wrong but as far as I can see now there are two
problems <br>
with ace/Message_Queue_T.cpp:</span><o:p></o:p></p>

<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Arial","sans-serif";
color:blue'>Currently, the latter (2) is solved but because of that (1), which
is my <br>
problem, has returned.</span><o:p></o:p></p>

<div>

<p class=MsoNormal>&nbsp;<o:p></o:p></p>

</div>

<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Arial","sans-serif";
color:blue'>Is it not possible to solve both problems with adding an extra
notify lock? </span><o:p></o:p></p>

<p class=MsoNormal><span style='font-family:"Arial","sans-serif"'><br>
</span><span style='font-size:10.0pt;font-family:"Arial","sans-serif";
color:blue'>I will point out my idea about this in the following fix code
example.</span><span style='font-family:"Arial","sans-serif"'><o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Arial","sans-serif";
color:blue'>This fix might be a problem because I think it needs some interface
change in <br>
ACE_Notification_Strategy too (to get a notification lock somehow) but you have<br>
more insight in the concequences of that. </span><span style='font-family:"Arial","sans-serif"'><o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Arial","sans-serif";
color:blue'>Maybe you first could have a look at this proposal?</span><span
style='font-family:"Arial","sans-serif"'><o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Arial","sans-serif";
color:blue'>+&nbsp;&nbsp;&nbsp;&nbsp; // Because we hold the notify lock, no
new notifications will occur on our<br>
+&nbsp;&nbsp;&nbsp;&nbsp; // target and it is safe to enqueue &amp; notify
hereafter...</span><span style='font-family:"Arial","sans-serif"'><o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Arial","sans-serif"'>&nbsp;&nbsp;&nbsp;
The application in short.<br>
&nbsp;&nbsp;&nbsp; -------------------------<br>
&nbsp;&nbsp;&nbsp; The part of our program where this deadlock appears is
dealing with <br>
&nbsp;&nbsp;&nbsp; processing messages from an embedded (CAN) network. <br>
&nbsp;&nbsp;&nbsp; There is a thread per CAN message center (hardware
communication channel)<br>
&nbsp;&nbsp;&nbsp; which puts the received message into ACE_Message_Queue's,
depending on who<br>
&nbsp;&nbsp;&nbsp; wants to observe the messages. These are the producer
threads.</span><o:p></o:p></p>

</div>

<div>

<p class=MsoNormal>&nbsp;<o:p></o:p></p>

</div>

<div>

<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Arial","sans-serif"'>&nbsp;&nbsp;&nbsp;
The message queues belongs to observers who all have registered to get<br>
&nbsp;&nbsp;&nbsp; notified by one Reactor which runs in one main Reactor
thread (consumer).<br>
&nbsp;&nbsp;&nbsp; (they also have registered themselves by the message center
threads as being<br>
&nbsp;&nbsp;&nbsp;&nbsp; interested in the messages).</span><o:p></o:p></p>

</div>

<div>

<p class=MsoNormal>&nbsp;<o:p></o:p></p>

</div>

<div>

<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Arial","sans-serif"'>&nbsp;&nbsp;&nbsp;
Problem cause<br>
&nbsp;&nbsp;&nbsp; --------------<br>
&nbsp;&nbsp;&nbsp; What can happen now is that the main Reactor, which is used
for many other <br>
&nbsp;&nbsp;&nbsp; things in our application, temporarily got other work todo,
and therefore<br>
&nbsp;&nbsp;&nbsp; the message center threads may fill up the
ACE_Select_Reactor notification<br>
&nbsp;&nbsp;&nbsp; PIPE. This causes the message center threads (producers) to
block on the <br>
&nbsp;&nbsp;&nbsp; (FULL) PIPE write().</span><o:p></o:p></p>

</div>

<div>

<p class=MsoNormal>&nbsp;<o:p></o:p></p>

</div>

<div>

<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Arial","sans-serif"'>&nbsp;&nbsp;&nbsp;
The main Reactor thread (consumer), when ready with the other work, wants to <br>
&nbsp;&nbsp;&nbsp; proceed with handling the pending notifications, and so
emptying the PIPE, <br>
&nbsp;&nbsp;&nbsp; but cannot do this because the current notification code
also holds the <br>
&nbsp;&nbsp;&nbsp; message QUEUE lock! <br>
&nbsp;&nbsp; <br>
&nbsp;&nbsp;&nbsp; See code description below:</span><o:p></o:p></p>

<p class=MsoNormal><br>
<span style='font-size:10.0pt;font-family:"Arial","sans-serif"'>&nbsp;&nbsp;&nbsp;
In above code snippet: <br>
&nbsp;&nbsp;&nbsp; this-&gt;notify (); Causes DEADLOCK when blocking on full
notification pipe.<br>
&nbsp;&nbsp;&nbsp; This happens because &lt;notify()&gt; is now called within
the scope of the <br>
&nbsp;&nbsp;&nbsp; ACE_GUARD_RETURN.</span><o:p></o:p></p>

</div>

<div>

<p class=MsoNormal>&nbsp;<o:p></o:p></p>

</div>

<div>

<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Arial","sans-serif"'>&nbsp;&nbsp;&nbsp;
In older versions of ACE, e.g. 5.3.1, the &lt;notify()&gt; was outside the
scope<br>
&nbsp;&nbsp;&nbsp; of the GUARD and we never had this deadlock.</span><o:p></o:p></p>

</div>

<div>

<p class=MsoNormal>&nbsp;<o:p></o:p></p>

</div>

<div>

<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Arial","sans-serif"'>&nbsp;&nbsp;&nbsp;
In SUBVERSION ACE, I can see this has been changed after revision<br>
&nbsp;&nbsp;&nbsp;&nbsp; r.46096 of Message_Queue_T.cpp (ChangeLogTag:Sat Mar
22 11:58:12 2003)<br>
&nbsp;&nbsp;&nbsp; But I don't know why.</span><o:p></o:p></p>

<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Arial","sans-serif"'>&nbsp;&nbsp;&nbsp;
SAMPLE FIX/WORKAROUND:<br>
&nbsp;&nbsp;&nbsp; Change ACE code so that &lt;this-&gt;notify();&gt; is
outside of GUARD scope?<br>
&nbsp;&nbsp;&nbsp; (like it was before in rev. 46096).</span><o:p></o:p></p>