[rules-dev] [Fwd: Re: [rules-users] determinism with rulebase partitioning]

Mark Proctor mproctor at codehaus.org
Fri Aug 1 13:27:52 EDT 2008


Forwarding the email to the dev mailing list, I meant the conversation 
to be on this list anyway - sorry.

mark

-------- Original Message --------


    I think that even with rulebase partitions, we should continue to 
support current execution mode. So, we should keep a rulebase 
configuration that basically allow the user to defines: either 
single-thread (as it is today) or multi-thread (as we are trying to 
achieve) execution.

    Having that in mind, in the multi-thread mode:

(A) What does "parallel evaluation of a rulebase" mean? Is it designed
to optimise, for example, two threads processing a stateless and
stateful session?
   Means that rules that do not share nodes, being independent of each 
other (from an evaluation perspective), will be evaluated in parallel. 
This is very common scenario and a desidered feature in CEP engines.

(B) Are there only two partitions, both of which are invisible to the
user? Is there any value in allowing user-defined partitions?
    There will be as many partitions as the compiler can create for the 
given set of rules. Rules that share more nodes, are more difficult to 
partition, while rules that are independent from an LHS point of view, 
are easier to parallelize. In my opinion, the only thing that may be 
helpful to expose and allow the user to control is the maximum size of 
the thread pool that is used to propagate facts. Even that I'm not sure 
is so helpful, because it is complex to fine tune such things, since the 
partitioning is completely dependent on the rules added to the rulebase.

(C) Does the partition used depend upon what type of session is used
(i.e. stateless always uses the partition without an agenda whereas
stateful always uses the partition with an agenda)?
    The partitioning of the rulebase is dependent upon the rules in the 
rulebase and nothing more. But that is different from the agenda. The 
agenda issue is much more complex, because even with partitions we can 
keep a single deterministic agenda (as long as it is not in active mode 
- runUntilHalt). Now, if the agenda is in active mode, or if we have 
multiple agendas (1 per partition, for instance), then the engine 
behavior becomes indeterministic. This is a common scenario in CEP 
systems that have multiple different "queries" running over the same set 
of streams, trying to detect and act upon them as soon as they are 
detected, and event streams are indeterministic by their own nature. In 
common rules engines scenarios, I'm not sure we can run in this 
indeterministic mode.

(D) Can a rule sometimes be deterministic and sometimes not (i.e.
depends upon the type of session)?
    It will always depend on the set of rules (the rulebase), not the 
type of session. One rule is always deterministic when considered in 
isolation, but two or more rules may or may not be deterministic in 
relation to each other. Just remember Eisten's Relativity Theory... ;)

   []s
   Edson

2008/8/1 Anstis, Michael (M.) <manstis1 at ford.com <mailto:manstis1 at ford.com>>

    Hi Mark,

    A few questions:-

    (A) What does "parallel evaluation of a rulebase" mean? Is it designed
    to optimise, for example, two threads processing a stateless and
    stateful session?

    (B) Are there only two partitions, both of which are invisible to the
    user? Is there any value in allowing user-defined partitions?

    (C) Does the partition used depend upon what type of session is used
    (i.e. stateless always uses the partition without an agenda whereas
    stateful always uses the partition with an agenda)?

    (D) Can a rule sometimes be deterministic and sometimes not (i.e.
    depends upon the type of session)?

    Cheers,

    Mike

    -----Original Message-----
    From: rules-users-bounces at lists.jboss.org
    <mailto:rules-users-bounces at lists.jboss.org>
    [mailto:rules-users-bounces at lists.jboss.org
    <mailto:rules-users-bounces at lists.jboss.org>] On Behalf Of Mark Proctor
    Sent: 01 August 2008 07:05
    To: Rules Users List
    Subject: [rules-users] determinism with rulebase partitioning

    We have rulebase partitioning almost working, this allows parallel
    evaluation of a rulebase. For stateless lessions with no agenda this
    will allow for much faster executions, where you don't care about
    deterministic execution. However for deterministic execution its more
    complicated. The current plan is to have an agenda per parition, which
    means that we no longer have rulebase wide deterministic execution
    order, only with the partition itself. The user is unlikely to be aware
    of the created partitions, so won't be aware of the unditermistic
    behavour of their rulebase. Anyone have any input on mechanisms users
    can do to help the rulebase know what needs to be executed
    deterministically and what doesn't?

    Mark
    _______________________________________________
    rules-users mailing list
    rules-users at lists.jboss.org <mailto:rules-users at lists.jboss.org>
    https://lists.jboss.org/mailman/listinfo/rules-users

    _______________________________________________
    rules-users mailing list
    rules-users at lists.jboss.org <mailto:rules-users at lists.jboss.org>
    https://lists.jboss.org/mailman/listinfo/rules-users




-- 
Edson Tirelli
JBoss Drools Core Development
JBoss, a division of Red Hat @ www.jboss.com <http://www.jboss.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-dev/attachments/20080801/631f37c1/attachment.html 


More information about the rules-dev mailing list