Same result. This is the source code. This test tells us that insert() locks too (too many internal resize and system memory operations).
I tested passing to thread class the session, the knowledge base and create session at thread construction time, at thread execution time. I obtain the same result for all tests. Oh, yes, if I insert "double a = Math.sqrt(1919) * Math.sqrt(1919);" in the thread execution without drools code, I can see 100% CPU usage :-) The only solution that increases CPU usage is the pooling one. Oh my god! public class KnowledgeSessionThread extends Thread { private static final int iterations = 500; private static final int numberFacts = 1000; private StatefulKnowledgeSession session; public KnowledgeSessionThread(StatefulKnowledgeSession sess) throws Exception { this.session = sess; } public void run() { try { for( int i = 0; i < iterations; i++ ) { for( int j = 0; j < numberFacts; j++ ) { Message msg = new Message(); msg.setMessage("Hello world"); msg.setStatus(Message.HELLO); session.insert(msg); } } session.fireAllRules(); session.dispose(); System.out.println("Thread finished " + this.currentThread().getName()); } catch( Exception e ) { e.printStackTrace(); } } } -- View this message in context: http://drools.46999.n3.nabble.com/StatefulKnowledgeSession-construction-executes-sequentially-no-multithread-tp3412107p3412530.html Sent from the Drools: User forum mailing list archive at Nabble.com. _______________________________________________ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users