• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Deadlocks??

 
sonir shah
Ranch Hand
Posts: 435
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey can anyone tell me the concept of deadlocks in threads..are they important from exam point of view?.

when can we use them and how?
Sonir
 
Jane Griscti
Ranch Hand
Posts: 3141
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi sonir,
Deadlocks are an important concept for the exam; you need to be able to recognize when they occur.
Deadlock usually occurs when two threads are each waiting for the other to give up the lock. For example, ThreadA gets the lock and then calls ThreadB but ThreadB can't do anything until ThreadA realeases the lock; which it won't do until it's call to ThreadB is is complete. Deadlock.

when can we use them and how?

You don't want to use them; you want to avoid them!
Hope that helps.
------------------
Jane Griscti
Sun Certified Programmer for the Java� 2 Platform
Co-author Mike Meyers' Java 2 Certification Passport
 
sonir shah
Ranch Hand
Posts: 435
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi.
if we are supposed to avoid them, does this concept is being asked in the SCJP exam?.
Sonir
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic