You can also split your application in multiple processes to use multiple
JVMs. if you have 8 threads it can be divided into starting two apps with 4
threads each. If you are working with Stateless session that shouldn't be a
problem.
Cheers
On Tue, Dec 11, 2012 at 7:23 AM, Wolfgang Laun <wolfgang.laun(a)gmail.com>wrote:
Looking at the code of the thread you are running in parallel
I guess that almost all of its time is spent in session creation,
and during this (and the dispose) the knowledge base is a
resource that needs protection. Thus, the test you are running
isn't well suited for demonstrating concurrency.
* Run one stateful session per thread, inserting and retracting
(random) facts.
* Add code wasting cycles to your rule(s).
Also, make sure that the global (which is shared between sessions)
isn't causing another bottleneck.
-W
On 11/12/2012, ping <jinpingv(a)hotmail.com> wrote:
> I tried profiling my test program and found that all thread spent most of
> their time blocking or waiting for the same lock:
>
org.drools.runtime.process.ProcessRuntimeFactory.getProcessRuntimeFactoryService()
> and
> org.drools.common.AbstractRuleBase.lock()
>
> examples:
>
> Thread-6 [WAITING] CPU time: 1s
> java.util.concurrent.locks.ReentrantReadWriteLock$WriteLock.lock()
> org.drools.common.UpgradableReentrantReadWriteLock.lowPriorityWriteLock()
> org.drools.common.UpgradableReentrantReadWriteLock.writeLock()
> org.drools.common.AbstractRuleBase.lock()
> org.drools.impl.StatelessKnowledgeSessionImpl.<init>(InternalRuleBase,
> KnowledgeAgent, KnowledgeSessionConfiguration)
> org.drools.impl.KnowledgeBaseImpl.newStatelessKnowledgeSession()
> java.lang.Thread.run()
>
>
>
> Thread-7 [BLOCKED] CPU time: 1s
>
org.drools.runtime.process.ProcessRuntimeFactory.getProcessRuntimeFactoryService()
>
org.drools.runtime.process.ProcessRuntimeFactory.newProcessRuntime(AbstractWorkingMemory)
> org.drools.common.AbstractWorkingMemory.createProcessRuntime()
>
org.drools.common.AbstractWorkingMemory.setKnowledgeRuntime(InternalKnowledgeRuntime)
> org.drools.impl.StatefulKnowledgeSessionImpl.<init>(ReteooWorkingMemory,
> KnowledgeBase)
> org.drools.impl.StatelessKnowledgeSessionImpl.newWorkingMemory()
> org.drools.impl.StatelessKnowledgeSessionImpl.execute(Object)
> java.lang.Thread.run()
>
>
>
>
> --
> View this message in context:
>
http://drools.46999.n3.nabble.com/Multi-threading-inefficiency-caused-by-...
> Sent from the Drools: User forum mailing list archive at
Nabble.com.
> _______________________________________________
> rules-users mailing list
> rules-users(a)lists.jboss.org
>
https://lists.jboss.org/mailman/listinfo/rules-users
>
_______________________________________________
rules-users mailing list
rules-users(a)lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users