Honeycomb
0.1
Component-Model Framework
|
Classes | |
class | Op |
Methods to perform thread-safe atomic read/write operations. More... | |
struct | SwapType |
Get the smallest atomically-swappable type that is large enough to hold T. More... | |
Typedefs | |
typedef platform::SwapMaxType | SwapMaxType |
Largest atomically-swappable type. More... | |
Enumerations | |
enum | Order { Order::relaxed, Order::consume, Order::acquire, Order::release, Order::acqRel, Order::seqCst } |
Atomic memory order for concurrent synchronization between threads. More... | |
Atomic operations.
typedef platform::SwapMaxType honey::atomic::SwapMaxType |
Largest atomically-swappable type.
|
strong |
Atomic memory order for concurrent synchronization between threads.
Compilers and hardware optimize ops assuming the environment is single-threaded, this causes race conditions in a concurrent environment.
The safest but slowest order is sequential consistency, load/store ops will not be optimized and thus will be executed in the order as written.
The fastest but unsafest order is relaxed, load/store ops can be fully optimized and thus re-ordered.
Release and acquire pairs provide a middle ground that allows some re-ordering.
A release on an atomic in thread 1 will synchronize with an acquire on that same atomic in thread 2.
Synchronization guarantees that all operations before the release in thread 1 will be executed before the acquire in thread 2.