12.5 Atomicity of variable references

博客介绍了数据类型的原子读写情况,指出uint、int、float和引用类型等的读写是原子的,enum类型在特定条件下读写也为原子的。而long、ulong等类型及用户定义类型的读写不一定是原子的,除特定库函数外,也无法保证原子的读-修改-写操作。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

uint, int, float, and reference types. In addition, reads and writes of enum
types with an underlying type
in the previous list shall also be atomic. Reads and writes of other types,
including long, ulong, double,
and decimal, as well as user-defined types, need not be atomic. Aside from
the library functions designed
for that purpose, there is no guarantee of atomic read-modify-write, such
as in the case of increment or
decrement.
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值