• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Liutauras Vilda
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Saloon Keepers:
  • Scott Selikoff
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
  • Frits Walraven
Bartenders:
  • Stephan van Hulst
  • Carey Brown

IllegalMonitorStateException (not what you think)

 
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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?
 
Ranch Hand
Posts: 68
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
what's in gvt.condition()?
 
Anonymous
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
gvt
 
Anonymous
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
The two armies met. But instead of battle, they decided to eat some pie and contemplate this tiny ad:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic