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
What is subsequence of a string?
What is difference between synchronize and concurrent collection in java?
Using callable statement how can you pass out parameters, explain with example?
What is the difference between a checked and an unchecked exception?
What is square root in java?
Can Exception handling we can handle multiple catch blocks?
what is meant by Garbage collection?
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.
How to sort double array in java?
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
Who developed java?
Can we create an object of private class?
Why declare Main() inside the class in java ?
What is final access modifier in java?
Can we sort hashmap in java?