I think Jin Lian wrote:

> It seems that the default Java synchronization mechanism has been used to
> coordinate which thread will be able to fire rules. If 10 threads come in
> simulstaneously and all want to fire a different rule, then 9 of them will
> have to wait while the execution engine is serving the request from one
> chosen thread.

If that's how you architect it, yes. Alternatively, as I said, one
thread can be dedicated to firing rules continuously, so that rule
firing for the various clients can be interspersed. And if you need
even more concurrency (on a multiprocessor machine, for example) then
you can use multiple engine objects.

> >In either case, the key to concurrent use is that each client-specific
> >item in the working memory has to be identifiable as such -- i.e., if
> >there's a ShoppingCart object, it needs to have a Client property, so
> >many independent ShoppingCarts can exist simultaneously.
> 
> Let's say the Shopping cart is wrapped in a JavaBean, and this JavaBean will
> be passed into Jess working memory for processing. In order for each bean to
> be independently "identifiable," each must be given a unique label while it
> is being passed into the working memory. Is this right?

If a shopping cart belongs to a specific session, and there will be
multiple simultaneous sessions, then that shopping care must be
identified with the session somehow, yes. The shopping cart beam might
just have a property containing the session cookie, for example.

> Also, the "working memory" of Jess is shared between all clients, right?

The working memory belongs to a single rule engine object. You can
have as many completely independent rule engine objects as you'd like
in a single process.


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

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