java - Are operations on ordinary variables atomic?
ringa_lee
ringa_lee 2017-05-27 17:41:25
0
2
601

We know that i is non-atomic, so is i=i 1 also non-atomic?

ringa_lee
ringa_lee

ringa_lee

reply all(2)
左手右手慢动作

From a java perspective, yes. Moreover, i++ is also atomic.

漂亮男人

i = i + 1 Non-atomic, if you want atomicity, please use AtomicInteger

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template