Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

How to make a method thread safe without using synchronized
keyword?

Answer Posted / venkat

Hi Jitender,

Here the scnroniziation is happening in methodA(){}
But the same thread(Thread-0) is executing even second time
also. Could you please clarify the same.

Here is the output.

Constructor..
Thread started..Thread-0
processing....Thread-0
Thread started..Thread-1
complete..Thread-0
processing....Thread-0
complete..Thread-0

Regards,
Venkat

Is This Answer Correct ?    0 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Can a class be protected in java?

1010


What is string immutability?

1175


What is hasnext in java?

1061


What is the purpose of the system class in java?

1094


Why is flag used in java?

1133


Is int a class in java?

1026


How do you implement polymorphism in our day to day life?

3284


What are the changes in java.io in java 8 ?

1079


Is heap stored in ram?

1013


What is Hierarchy of exception?

1139


What is method overloading in JAVA? Why is it not present in C ?

1142


Why to use nested classes in java? (Or) what is the purpose of nested class in java?

1118


What is structure of java heap? What is perm gen space in heap?

1180


What is indexof?

1028


Does A Class Inherit The Constructors Of Its Superclass?

1133