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

Explain throw keyword in java?

1037


What is the difference between == and === javascript?

1170


When will we use them?

1046


What does the “static” keyword mean? Can you override private or static method in java?

1086


What is the largest number a double can hold?

1039


What is stream api in java8?

1160


What is difference between float and double?

958


What is backdrop?

1063


What is a default method?

1044


What is proper subset?

973


How many types of operators are there?

975


What is r in java?

1046


What are the wrapped, classes?

1047


What is a boolean expression in java?

1017


How do I print a “?

994