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.
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:
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
posted
0
gvt
Anonymous
Ranch Hand
Joined: Nov 22, 2008
Posts: 18944
posted
0
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)