Hi there,

I am facing the following situation: In a few words, I have the following separate Threads running:

- a fireUntilHalt() on the StatefulKnowledgeSession --> Thread-1 in the picture
- a recurrent insertion of events into the knowledge base --> Thread-main in the picture
- a custom asynchroneous WorkItemHandler, which does some fake work and then signalizes completion to the flow engine (Threads 3&4 in the picture).


It is often the case that my program runs into a deadlock.

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.

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.


Please correct me if there is any misunderstanding from my side regarding the synchronization concepts.

Thanks and best

Markus


<<...>>