• 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

Avoiding deadlock

 
Ranch Hand
Posts: 694
Mac OS X Eclipse IDE Firefox Browser
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm not clear on how to avoid deadlock when using multiple threads.

-- Kaydell
 
Ranch Hand
Posts: 60
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This is a generic question. So I'll give search tips rather than try answering that.

You HAVE to understand what threads are, what monitors are, and what wait and notify methods really do. You could start here JavaWorld Article: Synchronizing Threads In Java which is probably one of the few articles that has any mention of a "potential monitor" to an object and implicitly distinguishes between an "object" and a "monitor".

These are the topics to google:

1. Java Thread Synchronization
2. Java Thread Deadlock
3. Java Object Monitor
4. Java Thread Tutorial

If you like to explore further, search for articles on IBM developer works and Artima. Look up JSR 133.

Sun is a nice place to find BEGINNER articles and tutorials on any topics. Just append SUN to your search string.
[ November 24, 2006: Message edited by: praveen balaji ]
 
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
there are many algorithms you can use to avoid deadlock.One of them is banker's algorithm and many resources are vaailable on net .
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic