I think Jordan Redner wrote:
> Is the assert method synchronized, and may multiple threads each with a
> handle on Rete call Rete.assert()?

The assert() methods themselves aren't synchronized, but the entire
Rete network is locked during the call, which effectively means that
assertions are done one-at-a-time.

I've experimented with finer-grained locking. What I've found is that
for most practical applications, it doesn't make things run any
faster. Individual join nodes will of course need to be locked while
their memories are manipulated, and they then form "barriers" which
ultimately result, once again, in one-at-a-time execution.

There's nothing to prevent you from using multiple Rete objects in one
application; each one is then independent of the others, and so each
can pattern-match in parallel. Many people have used an architecture
like this with pooled Rete objects.

> 
> Can I achieve more assertions per second by employing this strategy?  Is
> there a point of diminishing returns other than the System Thread overhead.
> 
> 

It's certainly useful to be able to assert from multiple threads at
once; there's no problem in doing so. It doesn't make things go any
faster, though.  Note that a call to run() can proceed in parallel
with pattern-matching. As long as the RHS of a rule doesn't assert,
modify, or retract any facts, it can run concurrently while assertions
are being processed.


> Jordan
> 




---------------------------------------------------------
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