[英]std::_Atomic_thread_fence (with capital A) is this correct?
The Visual Studio 2012 c++ documentation states that _ReadBarrier
and _WriteBarrier
intrinsics are now deprecated: Visual Studio 2012 c ++文档指出
_ReadBarrier
和_WriteBarrier
内在函数现在已弃用:
The
_ReadBarrier
,_WriteBarrier
, and_ReadWriteBarrier
compiler intrinsics and the MemoryBarrier macro are all deprecated and should not be used._ReadBarrier
,_WriteBarrier
和_ReadWriteBarrier
编译器内部函数以及MemoryBarrier宏均已弃用,不应使用。 For inter-thread communication, use mechanisms such asatomic_thread_fence
andstd::atomic<T>
that are defined in the C++ Standard Library Reference.对于线程间通信,请使用C ++标准库参考中定义的诸如
atomic_thread_fence
和std::atomic<T>
机制。 For hardware access, use the /volatile:iso compiler option together with thevolatile
(C++) keyword.对于硬件访问,将/ volatile:iso编译器选项与
volatile
(C ++)关键字一起使用。
Following the indications, I then jump to the atomic_thread_fence
documentation and it states that the function is defined on header <atomic>
. 按照指示进行操作,然后跳转至
atomic_thread_fence
文档 ,并指出该函数已在标头<atomic>
上定义。 If I include such header on my solution, I can't find the function, but I do find std::_Atomic_thread_fence
instead. 如果在解决方案中包含此类标头,则无法找到该函数,但可以找到
std::_Atomic_thread_fence
。
The naming suggests me this is a Microsoft-specific implementation. 命名建议我这是Microsoft特定的实现。 Is this a documentation problem or should I modify perhaps the default
#include
search paths? 这是文档问题,还是应该修改默认的
#include
搜索路径?
This seems to simply be a problem with the Visual Studio intellisense. 这似乎只是Visual Studio智能感知的问题。 If you correct it to
atomic_thread_fence
it should work just as intended. 如果将其更正为
atomic_thread_fence
则它应该可以按预期工作。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.