I was skinning through LLVM Atomic Instructions and Concurrency Guid, trying to figure how to create atomic (thread safe) store/loads.
I saw that there are load atomic
and store atomic
instructions.
load atomic
andstore atomic
provide the same basic functionality as non-atomic loads and stores, but provide additional guarantees in situations where threads and signals are involved.
I’m wondering how I can create them with the C++ API, currently I’m creating them with a IRBuilder
like so CreateLoad
and CreateStore
.
How can I create load atomic
and store atomic
operations?