<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=us-ascii">
<META NAME="Generator" CONTENT="MS Exchange Server version 6.5.7036.0">
<TITLE>Potential Deadlock using fireUntilHalt and signalEvent</TITLE>
</HEAD>
<BODY>
<!-- Converted from text/rtf format -->

<P><FONT SIZE=2 FACE="Arial">Hi there,</FONT>
</P>

<P><FONT SIZE=2 FACE="Arial">I am facing the following situation: In a few words, I have the following separate Threads running:</FONT>
</P>

<P><FONT SIZE=2 FACE="Arial">- a fireUntilHalt() on the StatefulKnowledgeSession --&gt; Thread-1 in the picture</FONT>

<BR><FONT SIZE=2 FACE="Arial">- a recurrent insertion of events into the knowledge base --&gt; Thread-main in the picture</FONT>

<BR><FONT SIZE=2 FACE="Arial">- a custom asynchroneous WorkItemHandler, which does some fake work and then signalizes completion to the flow engine (Threads 3&amp;4 in the picture).</FONT></P>
<BR>

<P><FONT SIZE=2 FACE="Arial">It is often the case that my program runs into a deadlock. </FONT>
</P>

<P><FONT SIZE=2 FACE="Arial">My impression is, that fireUntilHalt() (Thread1) gets the synchronized monitor on AbstractWorkingMemory.actionQueue in line 1411 , while the WorkItemManager (Thread3) gets the monitor on NamedEntryPoint in line 120.</FONT></P>

<P><FONT SIZE=2 FACE="Arial">When fireUntilHalt() then tries to get the monitor on NamedEntryPoint in line 260, while the WorkItemManager tries to get the monitor on AbstractWorkingMemory.actionQueue in line 1411, we have a deadlock.</FONT></P>
<BR>

<P><FONT SIZE=2 FACE="Arial">Please correct me if there is any misunderstanding from my side regarding the synchronization concepts.</FONT>
</P>

<P><FONT SIZE=2 FACE="Arial">Thanks and best </FONT>
</P>

<P><FONT SIZE=2 FACE="Arial">Markus</FONT>
</P>
<BR>

<P><FONT FACE="Arial" SIZE=2 COLOR="#000000"> &lt;&lt;...&gt;&gt; </FONT>
</P>

</BODY>
</HTML>