hivemind-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "John Coleman" <john.s.cole...@ntlworld.com>
Subject Re: wait - notify
Date Thu, 26 Jan 2006 12:04:25 GMT
yes, I considered that it seems possible due to the use of another thread -
however, I even tried synchronize using a seperate string object I defined
in the class, and it fails as well

I think I'll try a this.toString() to check your idea though, see what
reference I get.

thanks,
John

----- Original Message ----- 
From: "Achim Huegen" <achim.huegen@gmx.de>
To: <hivemind-user@jakarta.apache.org>
Sent: Thursday, January 26, 2006 9:16 AM
Subject: Re: wait - notify


> Could it be that this != this because one method works on a hivemind
> proxy and the other one on the unproxied core implementation?
>
> Achim
>
> John Coleman wrote:
> >
> > Hi,
> >
> > Any ideas if it could be HiveMind stopping this wait/notify code
running?
> >
> >   public void dispatchEvent(EventObject event) {
> >     events.add(event);
> >     System.out.println("dispatch event..." + event);
> >     synchronized (this) {
> >       notify(); // break wait state
> >     }
> >     System.out.println("notified");
> >   }
> >
> >   // a loop to dispatch events to the correct type of listeners
> >   public void run() {
> >     // loop handling all events until stop is true
> >     do {
> >       try {
> >         // wait for some event notifications
> >         synchronized (this) {
> >           wait();
> >         }....
> >
> >
> > If I do wait(10) then code works fine, but the sync blocks don't seem
> > effective. If I directly instantiate the classes w/o HM, then code
works!
> >
> > John
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: hivemind-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: hivemind-user-help@jakarta.apache.org
>



---------------------------------------------------------------------
To unsubscribe, e-mail: hivemind-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: hivemind-user-help@jakarta.apache.org


Mime
View raw message