18 #ifndef FOEDUS_ASSORTED_ATOMIC_FENCES_HPP_
19 #define FOEDUS_ASSORTED_ATOMIC_FENCES_HPP_
47 ::__atomic_thread_fence(__ATOMIC_ACQUIRE);
59 ::__atomic_thread_fence(__ATOMIC_RELEASE);
70 ::__atomic_thread_fence(__ATOMIC_ACQ_REL);
82 ::__atomic_thread_fence(__ATOMIC_CONSUME);
93 ::__atomic_thread_fence(__ATOMIC_SEQ_CST);
102 template <
typename T>
104 return ::__atomic_load_n(target, __ATOMIC_SEQ_CST);
113 template <
typename T>
115 return ::__atomic_load_n(target, __ATOMIC_ACQUIRE);
124 template <
typename T>
126 return ::__atomic_load_n(target, __ATOMIC_CONSUME);
134 template <
typename T>
136 ::__atomic_store_n(target, value, __ATOMIC_SEQ_CST);
144 template <
typename T>
146 ::__atomic_store_n(target, value, __ATOMIC_RELEASE);
152 #endif // FOEDUS_ASSORTED_ATOMIC_FENCES_HPP_
void atomic_store_seq_cst(T *target, T value)
Atomic store with a seq_cst barrier for raw primitive types rather than std::atomic.
Root package of FOEDUS (Fast Optimistic Engine for Data Unification Services).
T atomic_load_acquire(const T *target)
Atomic load with an acquire barrier for raw primitive types rather than std::atomic.
T atomic_load_consume(const T *target)
Atomic load with a consume barrier for raw primitive types rather than std::atomic.
void atomic_store_release(T *target, T value)
Atomic store with a release barrier for raw primitive types rather than std::atomic.
T atomic_load_seq_cst(const T *target)
Atomic load with a seq_cst barrier for raw primitive types rather than std::atomic.
void memory_fence_consume()
Equivalent to std::atomic_thread_fence(std::memory_order_consume).
void memory_fence_acquire()
Equivalent to std::atomic_thread_fence(std::memory_order_acquire).
void memory_fence_seq_cst()
Equivalent to std::atomic_thread_fence(std::memory_order_seq_cst).
void memory_fence_release()
Equivalent to std::atomic_thread_fence(std::memory_order_release).
void memory_fence_acq_rel()
Equivalent to std::atomic_thread_fence(std::memory_order_acq_rel).