[j-sim-users] Re: Possibly, a synchronization problem
Psoroulas Giannis
psoroulas at telecom.ntua.gr
Tue May 3 11:26:04 CDT 2005
Hello Tyan,
so far so good,
I synchronized the drcl.comp.ARuntime.off() in the original code and the
simulation seems to work just fine
(I am testing the code over a week).
For further problems I let you know.
Thanks in advance,
Psoroulas Giannis
----- Original Message -----
From: "Hung-ying Tyan" <tyanh at ieee.org>
To: "Psoroulas Giannis" <psoroulas at telecom.ntua.gr>
Sent: Wednesday, April 27, 2005 1:17 PM
Subject: Re: Possibly, a synchronization problem
>
> Psoroulas,
>
> Good catch! We wanted to synchronize in ARuntime instead of TreeMapQueue
> so can you synchronize the drcl.comp.ARuntime.off() method and use the
> original TreeMapQueue and see if you still get the exceptions? Thanks a
> lot!
>
> Hung-ying
>
> On Wed, 27 Apr 2005 17:43:43 +0800, Psoroulas Giannis
> <psoroulas at telecom.ntua.gr> wrote:
>
> > Hello Hung,
> >
> > I am writing to you in response to email
> > (http://mail.cs.uiuc.edu/pipermail/j-sim-users/2005-April/000603.html)
> >
> > I had mention that I get some exceptions (NullPointerException to be
more
> > specific) during the execution of some experiments that I make of.
> > The detailed traces of these exceptions are the following:
> >
> > ###### Exception trace n01
> > java.lang.NullPointerException
> > at java.util.TreeMap.rotateLeft(Unknown Source)
> > at java.util.TreeMap.fixAfterDeletion(Unknown Source)
> > at java.util.TreeMap.deleteEntry(Unknown Source)
> > at java.util.TreeMap.remove(Unknown Source)
> > at drcl.util.queue.TreeMapQueue._remove(Unknown Source)
> > at drcl.util.queue.TreeMapQueue.remove(Unknown Source)
> > at drcl.comp.ARuntime.off(Unknown Source)
> > at drcl.comp.Component.cancelFork(Unknown Source)
> >
> > --> here ends the references to my code
> > at VPC._cancelOldEvents(VPC.java:601)
> > at VPC._commitChanges(VPC.java:427)
> > at VPC._assignTask(VPC.java:417)
> > at VPC._wipeMessage(VPC.java:376)
> > at VPC.process(VPC.java:304)
> > --> here starts the references to my code
> >
> > at drcl.comp.TaskReceive.execute(Unknown Source)
> > at drcl.comp.AWorkerThread.run(Unknown Source)
> >
> > ###### Exception trace n02
> > java.lang.NullPointerException
> > at drcl.util.queue.TreeMapQueue.firstKey(Unknown Source)
> > at drcl.comp.ARuntime$WakeupThread.run(Unknown Source)
> > ARuntime.wakeupThread is corrupted, forcing JavaSim to exit!
> > Please report the bug to j-sim at cs.uiuc.edu.
> > Program exits.
> > ######
> >
> > I checked my code again and I still didn't found any conspicuous logical
> > error,
> > so I paid attention to those methods that are possibly invoked
> > concurrently
> > by multiple threads.
> > Following the trace of the exception I noticed that methods of
> > drcl.util.queue.TreeMapQueue object, which is a kind of wrapper of
> > java.util.TreeMap object, weren't "synchronized".
> > I modified the declaration of those methods that appeared to exception
> > trace, making them "synchronized" and I tested my code again. The
> > exception
> > trace turned into the following:
> >
> > java.util.NoSuchElementException
> > at java.util.TreeMap.key(Unknown Source)
> > at java.util.TreeMap.firstKey(Unknown Source)
> > at drcl.util.queue.TreeMapQueue.firstKey(Unknown Source)
> > at drcl.comp.ARuntime$WakeupThread.run(Unknown Source)
> > ARuntime.wakeupThread is corrupted, forcing JavaSim to exit!
> > Please report the bug to j-sim at cs.uiuc.edu.
> > Program exits.
> >
> > Finally, I made all methods of the drcl.util.queue.TreeMapQueue
> > "synchronized" and I have
> > no exceptions any more (I am testing the code over a week).
> > It is possible that there is a synchronization problem in j-sim platform
> > if
> > we take into the consideration
> > that the implmentation of java.util.TreeMap is not syncronized (it is
> > underlined in java API).
> > I also want to mention that a feature of my implementation is the high
> > rate
> > of creation and canceling fork messages.
> > Surely I don't have the overview of the j-sim platform that you do have,
> > so
> > I make my comments
> > with hesitation, hoping that may help you fixing bugs (if there are
any).
> >
> > Thanks in advance,
> >
> > Psoroulas Giannis
> >
> >
More information about the j-sim-users
mailing list