The Rete class is threadsafe but stateful. It is safe for multiple
clients to share an instance, but in doing so, they will be sharing
state. If you want multiple threads to share a single Rete object but
keep their data separate, then their data has to be
distinguishable. Every template used for client-specific data has to
have a slot in which some kind of client-id is kept, and the rules
need to be mindful of that client ID. Then the results for each client
could be kept separate. In this scenario, it's best to use
Rete.runUntilHalt() in a dedicated thread, so that the engine runs all
the time.

I think Dheeraj Kumar S wrote:
[Charset iso-8859-1 unsupported, filtering to ASCII...]
> Hi,
> 
> We are trying to build a small prototype using Jess which is webbased(Using
> servlet). We are having some 1000 Rules and scenario is multiple clients
> will be hitting this servlet to evaluate the rules and get the outcome from
> each rule based on the type of client. Now the problem is when multiple
> clients try to access this servlet , the 'rete' object is holding the state
> of the other client. basically it is not clearing the network to cater to
> other client request. We want to load the rule.clp file only once and still
> render to multiple client access. Plz let me know if we can do this without
> synchronizing the rete object. I mean we want multithreading. We are tryng
> to work on both Jess 6 and Jess 7 versions. Your help is very much
> appreciated. Kindly send me some code snippets if you any.
> Regards,
> dheeraj



---------------------------------------------------------
Ernest Friedman-Hill  
Advanced Software Research          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