This week's book giveaway is in the General Computing forum.
We're giving away four copies of Arduino in Action and have Martin Evans, Joshua Noble, and Jordan Hochenbaum on-line!
See this thread for details.
The moose likes Threads and Synchronization and the fly likes IllegalMonitorStateException (not what you think) Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


JavaRanch » Java Forums » Java » Threads and Synchronization
Reply Bookmark "IllegalMonitorStateException (not what you think)" Watch "IllegalMonitorStateException (not what you think)" New topic
Author

IllegalMonitorStateException (not what you think)

Anonymous
Ranch Hand

Joined: Nov 22, 2008
Posts: 18944
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

Joined: Nov 04, 2001
Posts: 68
what's in gvt.condition()?


dan moore, infomatiq ltd.<br />email dan@infomatiq.co.uk<br /><a href="http://www.infomatiq.co.uk" target="_blank" rel="nofollow">http://www.infomatiq.co.uk</a>
Anonymous
Ranch Hand

Joined: Nov 22, 2008
Posts: 18944
gvt
Anonymous
Ranch Hand

Joined: Nov 22, 2008
Posts: 18944
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.
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: IllegalMonitorStateException (not what you think)
 
Similar Threads
wait, notify IllegalMonitorStateException
ExamLab Exception
Feed the Pets
IllegalMonitorStateException
Where is defination of inbuilt interfaces are written?