I think Gang Liu wrote:
> hi, all
> I got a question of multiple rules and multiple facts. Please help me out.
> 
> Two scenarios:
> 1. We have 2 facts in memory and they can fire one rule both. Are 2 facts 
> triggered sequencially? If RHS of that rule takes 5 ms to execute, the time 
> to trigger 2 facts will be at least 10 ms? Are there some ways of triggering 
> 2 facts in parallel?
> 

I'm really not sure what you're using the word "trigger" to mean here,
but I'm pretty sure the answer is "no." Things in Jess happen
sequentially, in a very controlled order. There has been plenty of
research on parallel production systems, and on parallel Rete
implementatons, even. In most practical systems, though, there are too
many join points for parallelization to do much good. Furthermore, the
amount of work needed to fire any given rule is different than the
amount needed for other rules, so simple parallelizations tend not to
have any benefit at all (recall Amdahl's law.)  And of course, there's
no way to create a parallel implementation that runs as fast on a
single processor as an intrinsically uniprocessor version does --
threads add overhead.

> 2.We have 1 fact and it can fire 2 rules. Are 2 rules fired in seqence? 
> Suppose RHS of the first fired rule takes 5 ms to execute, the second rule 
> has to wait for 5 ms to fire?

Yes, rules fire one at a time, in a very specific order, as controlled
by salience and by the active Strategy object.

> 
> It seems that the questions are related to performance and thread-safe.

Indeed.


---------------------------------------------------------
Ernest Friedman-Hill  
Distributed Systems Research        Phone: (925) 294-2154
Sandia National Labs                FAX:   (925) 294-2234
Org. 8920, MS 9012                  [EMAIL PROTECTED]
PO Box 969                  http://herzberg.ca.sandia.gov
Livermore, CA 94550

--------------------------------------------------------------------
To unsubscribe, send the words 'unsubscribe jess-users [EMAIL PROTECTED]'
in the BODY of a message to [EMAIL PROTECTED], NOT to the list
(use your own address!) List problems? Notify [EMAIL PROTECTED]
--------------------------------------------------------------------

Reply via email to