高级比较和交换(CAS)功能? [英] High-level Compare And Swap (CAS) functions?

查看:74
本文介绍了高级比较和交换(CAS)功能?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想说明比较和交换(CAS)原子基元可以使用哪些高级功能(即C ++,而不是内联汇编程序).

I'd like to document what high-level (i.e. C++ not inline assembler ) functions or macros are available for Compare And Swap (CAS) atomic primitives...

例如,x86上的WIN32在<_intrin.h>标头中具有一系列功能_InterlockedCompareExchange.

E.g., WIN32 on x86 has a family of functions _InterlockedCompareExchange in the <_intrin.h> header.

推荐答案

我将让其他人列出各种特定于平台的API,但为了将来在C ++ 09中提供参考,您将获得

I'll let others list the various platform-specific APIs, but for future reference in C++09 you'll get the

atomic_compare_exchange() 

新的原子操作库"中的操作.

operation in the new "Atomic operations library".

这篇关于高级比较和交换(CAS)功能?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆