atomic 原子自增工程案例
摘要:
案例 1 : 简单用法 atomic_int id; atomic_fetch_add(&id, 1) atomic_uint id; atomic_fetch_add(&id, 1) 以上是两种原子自增简单非常常见用法. 但和业务联动时候存在潜在问题. 例如第一段代码中 atomic_fetch_
阅读全文
案例 1 : 简单用法 atomic_int id; atomic_fetch_add(&id, 1) atomic_uint id; atomic_fetch_add(&id, 1) 以上是两种原子自增简单非常常见用法. 但和业务联动时候存在潜在问题. 例如第一段代码中 atomic_fetch_
阅读全文
posted @ 2022-02-08 15:30
浙公网安备 33010602011771号