// QuasiAtomic encapsulates two separate facilities that we are // trying to move away from: "quasiatomic" 64 bit operations // and custom memory fences. For the time being, they remain // exposed. Clients should be converted to use either class Atomic // below whenever possible, and should eventually use C++11 atomics. // The two facilities that do not have a good C++11 analog are // ThreadFenceForConstructor and Atomic::*JavaData. // // NOTE: Two "quasiatomic" operations on the exact same memory address // are guaranteed to operate atomically with respect to each other, // but no guarantees are made about quasiatomic operations mixed with // non-quasiatomic operations on the same address, nor about // quasiatomic operations that are performed on partially-overlapping // memory. class QuasiAtomic { public: staticvoid ThreadFenceForConstructor() { #ifdefined(__aarch64__)
__asm__ __volatile__("dmb ishst" : : : "memory"); #else
std::atomic_thread_fence(std::memory_order_release); #endif
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.