Recommended Memory Barrier
If the logic for multiple threads to access the critical area is unclear, you are advised to use the __ATOMIC_SEQ_CST barrier to avoid consistency problems caused by improper use of the barrier.
A common database scenario is lock operations. A critical area is formed between lock acquire and release to ensure the consistency of the critical area.
Parent topic: Common Atomic Operations (C Language)