Thread overview | |||||
---|---|---|---|---|---|
|
September 13, 2017 Is there further documentation of core.atomic.MemoryOrder? | ||||
---|---|---|---|---|
| ||||
Is there a formal description of "hoist-load", "hoist-store", "sink-load", and "sink-store" as used in core.atomic.MemoryOrder (https://dlang.org/library/core/atomic/memory_order.html)? |
September 17, 2017 Re: Is there further documentation of core.atomic.MemoryOrder? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Nathan S. | On Wednesday, 13 September 2017 at 14:40:55 UTC, Nathan S. wrote: > Is there a formal description of "hoist-load", "hoist-store", "sink-load", and "sink-store" as used in core.atomic.MemoryOrder (https://dlang.org/library/core/atomic/memory_order.html)? You can read this: https://llvm.org/docs/Atomics.html#atomic-orderings And use this: ``` static if (ms == MemoryOrder.acq) { enum _ordering = AtomicOrdering.Acquire; } else static if (ms == MemoryOrder.rel) { enum _ordering = AtomicOrdering.Release; } else static if (ms == MemoryOrder.seq) { enum _ordering = AtomicOrdering.SequentiallyConsistent; } else static if (ms == MemoryOrder.raw) { enum _ordering = AtomicOrdering.Monotonic; } ``` -Johan |
October 03, 2017 Re: Is there further documentation of core.atomic.MemoryOrder? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Johan Engelen | Thank you. For anyone else with the same question, I also found this page helpful: http://en.cppreference.com/w/cpp/atomic/memory_order |
Copyright © 1999-2021 by the D Language Foundation