Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Threads

 
Vihanga Rajalingam
Greenhorn
Posts: 3
Android Java Mac PPC
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Marshal
Pie
Posts: 21504
84
C++ Chrome Eclipse IDE Firefox Browser Java jQuery Linux VI Editor Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic