HTH:
You could use memory_order_relaxed to minimize the cost, but you need to fully understand it.
If not, just use default std::atomic and think about optimization later.
HTH:
You could use memory_order_relaxed to minimize the cost, but you need to fully understand it.
If not, just use default std::atomic and think about optimization later.