• Post Reply Bookmark Topic Watch Topic
  • New Topic

Threads and deadlocks  RSS feed

 
chenna reddy
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Sheriff
Posts: 9610
37
Android Google Web Toolkit Hibernate IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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??
 
Miklos Szeles
Ranch Hand
Posts: 142
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Marshal
Posts: 56518
172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can almost always find something useful in the Java™ Tutorials.
 
Vinod Tiwari
Ranch Hand
Posts: 466
1
IntelliJ IDE Java Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!