Thanks that helped. Now is working!
[EMAIL PROTECTED] wrote:
> Well, your example is simplified, as you say, so I can't tell with
> certainty. But it might be that you're under the impression that
> locating the method callReteLoop() in a subclass of Thread
> automatically means that any calls to it will return immediately while
> the method runs in some other concurrent process. This is not how it
> works. Only code in the run() method of a Thread class will be run in
> a new thread, and then only by calling the start() method of that same
> object; start() calls run() in a new thread. Your GUI is freezing
> because instead you're calling runUntilhalt() directly in the
> event-handling thread, which is therefore busy until the method
> returns.
>
> Here's a very simple version that uses a anonymous inner class (the
> run() method will need a JessException try/catch block which I've
> omitted here.)
>
> class JessGui extends JFrame {
> ...
> if (button1.clicked())
> new Thread() { public void run() { rete.runUntilHalt(); }}.start();
>
> When the button is clicked, the engine runs in a new Thread. As I said,
> this is a very simple version. If you want to do fancier things,
> you're probably going to need to learn more about how Threads work;the
> Java tutorial at java.sun.com is actually quite nice and has a good
> Threads section.
>
> I think S.S.Ozsariyildiz wrote:
> >
> > Hi,
> >
> > The problem is when I call the run-until-halt command is waits and all
> > the swing based gui's are frozen. (With out run-until-halt every thing
> > works fine also with run it works) What may cause the problem ant Ideas?
> > Are there any examples or explanations how to use ACTIVATION LOCK in
> > Rete?
> >
> > The simplified class structure looks like this.
> >
> > class mainApp {
> > JessGui j1;
> > App1 a1;
> > ......
> > }
> >
> > class JessGui extends JFrame {
> > JessThread jt1;
> > ......
> > if (button1 clicked) callReteLoop();
> > // this locks the gui. It does not let the gui to update though its not
> > the JessThread.
> > // it also locks the App1 no updates there as well.
> > ......
> > }
> >
> > JessThread extends Thread {
> > static Rete rete;
> > static initJess(){}
> > ......
> > callReteLoop(){
> > rete.runUntilHalt();
> > }
> > }
> >
> > App1 extends Thread {
> > ....
> > //some where I access to the jess engine by using the static member
> > in JessThread
> > putInstancetoJess(){
> > JessThread.rete.executeCommand(....)
> > }
> > }
> >
> > thanks.
> >
> >
> > ---------------------------------------------------------------------
> > 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]
> > ---------------------------------------------------------------------
> >
>
> ---------------------------------------------------------
> 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]
---------------------------------------------------------------------