aspose file tools
The moose likes Beginning Java and the fly likes Threads and deadlocks Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » Beginning Java
Reply Bookmark "Threads and deadlocks" Watch "Threads and deadlocks" New topic
Author

Threads and deadlocks

chenna reddy
Greenhorn

Joined: Sep 13, 2009
Posts: 5
1) What do you mean by deadlock in java?
2) How can we prevent deadlock's?
3) Is there any way to access OS threads from java?

[MG]Edited title from "Hi" to make it meaningful
Ankit Garg
Saloon Keeper

Joined: Aug 03, 2008
Posts: 9189
    
    2

chenna please Use A Meaningful Subject Line when you start a topic.

Did you try to do a google search about deadlocks in java. There are hundreds of tutorials on it. Also are you talking about accessing OS processes??


SCJP 6 | SCWCD 5 | Javaranch SCJP FAQ | SCWCD Links
Miklos Szeles
Ranch Hand

Joined: Oct 21, 2008
Posts: 142
Hi Chenna,

1, Deadlock is not Java specific it means the same thing independently from programming languages. As Ankit advice search for it if you don't know what deadlock means.
2, You can prevent them with proper programming. It's not an easy subject.
3, You can use java.lang.Thread to handle threads in java.
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 32651
    
    4
You can almost always find something useful in the Java™ Tutorials.
Vinod Tiwari
Ranch Hand

Joined: Feb 06, 2008
Posts: 458
Hi Chenna,

1) Deadlock refers to a specific condition when two or more processes are each waiting for each other to release a resource, or more than two processes are waiting for resources in a circular chain. Its a concept not limited to Java.
2) There are various algorithms which could be used to avoid this eg: Banker's Algorithm. In Java you can use syncronization keyword.
3) What do you mean by OS thread??

Try to search OS Deadlock and you'll find tons of results for help.

Thanks
Vinod
 
I agree. Here's the link: http://zeroturnaround.com/jrebel
 
subject: Threads and deadlocks
 
Similar Threads
User and Daemon threads
regarding threads
Two threads of same class instance to wait separately
threads
What is Demon Thread?