Quantcast
Channel: Is using AtomicInteger in a java multithreading program slower and inefficient than other methods of synchronization? - Stack Overflow
Viewing all articles
Browse latest Browse all 3

Is using AtomicInteger in a java multithreading program slower and inefficient than other methods of synchronization?

$
0
0

I am carrying out an experiment with two multithreading java programs. I have one that is not synchronized and another that is using AtomicInteger. The AtomicInteger is much slower. I think this might be because of the method AtomicInteger uses compareAndset(). Am I correct?


Viewing all articles
Browse latest Browse all 3

Latest Images

Trending Articles





Latest Images