Win a copy of Machine Learning Systems: Designs that scale this week in the Scala forum
or Xamarin in Action: Creating native cross-platform mobile apps in the Android forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

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 .
 
The moustache of a titan! The ad of a flea:
Rocket Oven Kickstarter - from the trailboss
https://coderanch.com/t/695773/Rocket-Oven-Kickstarter-trailboss
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!