This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line!
See this thread for details.
The moose likes Java in General and the fly likes Threads Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » Java in General
Bookmark "Threads" Watch "Threads" New topic
Author

Threads

Vihanga Rajalingam
Greenhorn

Joined: Aug 26, 2012
Posts: 3

class Demo{
public static void main(String args[]){
final A a1=new A();
final A a2=new A();
new Thread(){
public void run(){
synchronized(a1){
//if yield
synchronized(a2){
//
}
}
}
}.start();
//-----------------------
new Thread(){
public void run(){
synchronized(a2){
//if yield
synchronized(a1){
//
}
}
}
}.start();
}
}
class A{}


What does this program mean?
Henry Wong
author
Sheriff

Joined: Sep 28, 2004
Posts: 20050
    
  44

Vihanga Rajalingam wrote:


What does this program mean?


You have to help us help you. There are lots of concepts going on in this example, and we have no idea of what your knowledge is? Do you know threading? If so, how much? Do you know what an inner class is? Please read this...

https://www.coderanch.com/how-to/java/TellTheDetails

Also take a look at other tips here ... https://www.coderanch.com/how-to/java/HowToAskQuestionsOnJavaRanch

Henry


Books: Java Threads, 3rd Edition, Jini in a Nutshell, and Java Gems (contributor)
 
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com
 
subject: Threads
 
It's not a secret anymore!