L
lordy
Hi, I want to keep a running 'int' total across threads but without the
'synchronized' overhead. (This total will be spinning pretty fast).
I'm guessing Most processors have some kind of atomic (and hopefully) thread safe increment command.
However a big of Googling suggests this may be possible in Java 1.5 but
not in Java 1.4.2 ('Twas an IBM article http://www-128.ibm.com/developerworks/java/library/j-jtp11234/)
I guess the most performant(?) option is to maintain separate totals and
combine them at report time?
Lordy
'synchronized' overhead. (This total will be spinning pretty fast).
I'm guessing Most processors have some kind of atomic (and hopefully) thread safe increment command.
However a big of Googling suggests this may be possible in Java 1.5 but
not in Java 1.4.2 ('Twas an IBM article http://www-128.ibm.com/developerworks/java/library/j-jtp11234/)
I guess the most performant(?) option is to maintain separate totals and
combine them at report time?
Lordy