Does JBoss Drools really execute all rules in parallel?

冷暖自知 提交于 2019-12-04 07:35:53

There is no indication of parallelism in the standard rete algorithm. A conflict set is produced of matched rules, the agenda then applies a strategy for firing those rules in turn.

Over the years a number of efforts have been done to parallelise part(s) of the rete, either during the matching or firing stages.

A big problem when firing all rules in parallel is determinstic execution.

We are currently exploring various strategies to concurrent and parallel matching, in Drools. We will explore concurrent rule firing too, but we need to find more robust ways for users to indicate what can be fired in parallel and what can't; so that the user gets deterministic execution where they need it.

It looks like that you have solved the problem, but I can still provide some more information if you need. There is a concurrent library used in the source code of Drools, the github web link is shown, https://github.com/kiegroup/drools/blob/master/drools-core/src/main/java/org/drools/core/concurrent/ExecutorProviderImpl.java.

Some points,

  1. Sure, the thread factory is used in the operation executor. And you can find the thread library if you read the source code shown in this weblink.

  2. Also you ask about the maxThread, the threadpool used in Drools does have a pool size as shown in the source code. newExecutor = new ThreadPoolExecutor( Pool.SIZE, Pool.SIZE, 60L, TimeUnit.SECONDS,new LinkedBlockingQueue<Runnable>(), threadFactory );

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!