• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

threading problem

 
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello
I am almost done with my SCJD assignment and I am testing it thoroughly. I am facing the following problem that is occuring randomly:
I am using wait(), notifyAll() for my lock/unlock operations.
Randomly, one of the threads gets stuck in the wait() status and wouldn't gets activated although I call notifyAll at the unlock.
Any suggestion?
 
Ranch Hand
Posts: 62
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Are you sure that your unlock is being called, even if an exception occurs?
Rama
 
Ranch Hand
Posts: 116
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi fadi,
instead of catching for specific exceptions try to catch Throwable and print the stacktrace of it to track down things .. am sure something exception is going un noticed in your coded creating these problems.
hope this helps,

cheers,
parthi.
 
fadi mujahid
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello
Thank you very much for your help. I finally figured it out: I was wait()ing the object Data, and notifyAll() on object locks!!!
This stupid problem cost me more than 20 hours of debugging.
Thanks again
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic