aspose file tools*
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Deadlocks?? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "Deadlocks??" Watch "Deadlocks??" New topic
Author

Deadlocks??

sonir shah
Ranch Hand

Joined: Nov 01, 2001
Posts: 435
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

Joined: Aug 30, 2000
Posts: 3141
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


Jane Griscti
SCJP, Co-author Mike Meyers' Java 2 Certification Passport
sonir shah
Ranch Hand

Joined: Nov 01, 2001
Posts: 435
Hi.
if we are supposed to avoid them, does this concept is being asked in the SCJP exam?.
Sonir
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Deadlocks??