HOW IS THERE SUCH A HUGE DIFFERENCE BETWEEN THE NUMBERS ???
COULD BE BECAUSE OF THE POINT OF SYNCHRONIZATION ???
Steve
Originally posted by Anish Shah:
both logging and incrementing can happen together as both use differnt shared data.. Logging does not require and data from 1st method so it can exclusively...
Steve
Originally posted by Anish Shah:
You mean to say if there are 5 synchornized methods in a class in a multithreaded system.. then ony one of those method can execute at a time..
i wish this is wrong.. please give me a good idea on it..
Originally posted by Anish Shah:
Just was thinking about this whole synchronized waiting thing on the same object... Guys please tell me one thing.. say for example .. we are using the instance variable debit in 1st synchronized method and this same variable is used in another unsynchronized method where it is being just read.. so the read can happen on tihs instance variable without wait ??
Originally posted by Anish Shah:
Also, what would be the way out of this thing if we have multiple synchronized methods not using the same shared data in the same class i.e same instant..if we use synchronization within methods.would this help ??
how do we do this ??
Originally posted by Anish Shah:
Sorry if any of my question sound stupid to anyone.. I am just trying to learn something that i got to know very recently..
Thanks for all the replies..
Thank you..
Steve
Orginally posted by : Anish Shah
Expected time was : 5000 * 2500 = 125000000 = 125 millis
Perform for today. Adapt for tomorrow.
Ever since I found this suit I've felt strange new needs. And a tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
|