Win a copy of Practical SVG this week in the HTML/CSS/JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

IllegalMonitorStateException (not what you think)

 
Anonymous
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am running a multithreaded Java program on an SGI Origin 2000 multiprocessor machine. I am getting an IllegalMonitorStateException even though I am not calling wait/notify/notifyAll. Here is the error:

Here is the code:
Processor

parent

Any thoughts?
 
dan moore
Ranch Hand
Posts: 68
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
what's in gvt.condition()?
 
Anonymous
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
gvt
 
Anonymous
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I seem to have fixed it. I merely moved the checks into the parent class, and enclosed them in a single synchronized block. This may be more efficient anyway.
There are some similar bugs posted in Sun's bug database. They marked the bugs as not-reproducable, and closed the topic. There may be something subtle about the locks and the short-circuit condition statement that may cause this problem on different multiprocessor architectures.
Relaxed memory models also introduce sublties that must be programmed for. A good, short article is 'Multiprocessor Saftety and Java', by Paul Jakubik, in case anyone is intersted.
I thought I would wrap this up with what I found out. Please let me know if anyone finds anything out more conclusive. Thanks.
...Mike B.
 
Screaming fools! It's nothing more than a tiny ad:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!