[rules-users] Is drools ksession thread-safe?
    jschmied 
    nabble at juergenschmied.de
       
    Wed Oct 20 05:17:28 EDT 2010
    
    
  
I think no. I use a session in a multithread environment I had to put a
wrapper with synchronized methods around it to prevent random locks.
FireUntilHalt consumes 100% CPU. I have a ruleflow and found:
while (ksession.getPrcState(prc) == ProcessInstance.STATE_ACTIVE) {
	Threads.sleep(10);
	ksession.fireAllRules();
}
performs much better.
The functions are:
		public synchronized int fireAllRules() {
			return kSession.fireAllRules();
		}
		public synchronized int getPrcState(ProcessInstance prc) {
			return prc.getState();
		}
of my threadsafe warpper class.
juergen
-- 
View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/Is-drools-ksession-thread-safe-tp1736738p1737521.html
Sent from the Drools - User mailing list archive at Nabble.com.
    
    
More information about the rules-users
mailing list