Put the changes into Jess61a3 and it worked as you suspected.
Threads working properly is a bit harder to diagnose than threads behaving
badly though. We ran our stuff about 15 times with some debug statements
put in and everything seemed to work through the salience correctly. Lack
of errors, doesn't necessarilly mean success, but we'll be running the code
an awful lot and will let you know if we see any discrepencies.
Thank you very much,
Scott
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On
Behalf Of [EMAIL PROTECTED]
Sent: Thursday, October 10, 2002 10:00 PM
To: [EMAIL PROTECTED]
Subject: Re: JESS: run-until-halt and salience
I think [EMAIL PROTECTED] wrote:
>
> This is a really interesting problem -- your diagnosis skills are
> excellent. The current behavior certainly is logical and practical,
> but unfortunately, you're right, it does make salience somewhat
> less... salient.
>
> One possibility would be for Jess to be modified such that all the
> activations due to a single assertion, retraction, or modification
> must appear on the agenda atomically, such that no rules could fire
> while they were being added. I'll have to think about whether this is
> desirable or even possible.
>
Scott --
There's actually a very easy way to implement this idea; I'd love it
if you'd try it and report back.
In any recent version of Jess, in jess/Agenda.java, in the
two-argument form of run(), there's a while loop that looks like this:
while (!m_halt && n < max && (a = getNextActivation(r)) != null) {
...
}
Change it to look like this:
while (!m_halt && n < max) {
synchronized (r.getCompiler()) {
if (a = getNextActivation(r)) == null)
break;
...
}
}
This will ensure that no rule can fire while an assert, retract, or
modify is executing on another thread.
Let me know how it goes.
---------------------------------------------------------
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]
--------------------------------------------------------------------
--------------------------------------------------------------------
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]
--------------------------------------------------------------------