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

What is subsequence of a string?

1037


What is difference between synchronize and concurrent collection in java?

991


Using callable statement how can you pass out parameters, explain with example?

1168


What is the difference between a checked and an unchecked exception?

929


What is square root in java?

1038


Can Exception handling we can handle multiple catch blocks?

981


what is meant by Garbage collection?

1039


there are N number of matchboxes numbered 1...N.each matchbox contain various number of stick.Two player can alternatevely pick some amount of stick from the higest stick containing box . The player is condidered win if there is no stick after his move.Find the final move so that the move player win. Note:In case the number of stick is equal ,pick the stick from the higest numbered box.

1945


How to sort double array in java?

946


Java openings 3 - 5 years, Lnt Infotech. requirements - core java, J2ee, struts, hibernate Interview Date:- 19 March 2011 Time:- 9:00 AM to 12:00 Pm Interview Location - L & T Infotech, Manapakkam, Chennai Refererral PS NO:- 291649 (Please mention this when u fill the form only then u will be considered for interview) Documents Required:- Latest Resume, Photograph and last 3 payslips Mail me on vasan2211@gmail.com once u appear for interview

3298


Who developed java?

940


Can we create an object of private class?

914


Why declare Main() inside the class in java ?

994


What is final access modifier in java?

1073


Can we sort hashmap in java?

899