But then you lose the whole purpose of locking and atomicity, which clearly shows the necessity of using the memory constraint.
但这样您会无法理解锁定和原子性的全部意图,这些明确显示了使用内存约束的必要性。
However, even under the newly proposed memory model, double-checked locking will not work.
尽管如此,即使是在新提议的内存模型中,双重检查锁定也是无效的。
Under the new memory model, this "fix" to double-checked locking renders the idiom thread-safe.
在新的内存模型中,对双重检查锁定的这个“修复”使 idiom 线程安全。
应用推荐