| 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
|
|
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
|
|
|
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
|
 |
 |
|
|
subject: Threads and deadlocks
|
|
|