We know this could happen. But forced to do thread-safe, would cause extra performance impact because CPU cache is not working anymore. Sheng Wu 吴晟 Twitter, wusheng1108
Forrest Wang <[email protected]> 于2024年9月25日周三 14:35写道: > > Hi wusheng: > Is there a thread-safe problem about the following field? Is it > necessary to make all of the elements of this array volatile? > For example, when thread A set buffer[1] to null, but the old value > of buffer[1] is in the cache of cpu which Thread B is running on. Then the > save action will fail if strategy is IF_POSSIBLE. > B.R. > > > >
