• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Knute Snortum
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Ganesh Patekar
  • Stephan van Hulst
  • Pete Letkeman
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Ron McLeod
  • Vijitha Kumara

Avoiding deadlock  RSS feed

 
Ranch Hand
Posts: 693
Eclipse IDE Firefox Browser Mac OS X
  • Mark post as helpful
  • send pies
  • 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
  • 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
  • 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 .
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!