Home > Q&A > body text
We know that i is non-atomic, so is i=i 1 also non-atomic?
ringa_lee2017-05-27 17:43:25
From a java perspective, yes. Moreover, i++ is also atomic.
i++
漂亮男人2017-05-27 17:43:25
i = i + 1 Non-atomic, if you want atomicity, please use AtomicInteger
i = i + 1