简体   繁体   English

std :: __ Atomic_thread_fence(大写A)正确吗?

[英]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 as atomic_thread_fence and std::atomic<T> that are defined in the C++ Standard Library Reference. 对于线程间通信,请使用C ++标准库参考中定义的诸如atomic_thread_fencestd::atomic<T>机制。 For hardware access, use the /volatile:iso compiler option together with the volatile (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.

相关问题 这种std :: atomic_thread_fence的使用是否正确? - Is this use of std::atomic_thread_fence correct? atomic_thread_fence不是std的成员 - atomic_thread_fence is not a member of std 为什么这个 `std::atomic_thread_fence` 工作 - Why does this `std::atomic_thread_fence` work 为什么std :: atomic_thread_fence具有“ C”链接? - Why does std::atomic_thread_fence have “C” linkage? std :: atomic_thread_fence具有未定义的引用 - std::atomic_thread_fence has undefined reference 在具有相同顺序的原子加载/存储之前使用 std::atomic_thread_fence 总是多余的吗? - Is using std::atomic_thread_fence right before an atomic load/store with the same order always redundant? 获取条件std :: atomic_thread_fence的优点和缺点是什么? - Benefits & drawbacks of as-needed conditional std::atomic_thread_fence acquire? 在 x86 上实现 std::atomic_thread_fence(std::memory_order_seq_cst) 没有额外的性能损失 - An implementation of std::atomic_thread_fence(std::memory_order_seq_cst) on x86 without extra performance penalties atomic_thread_fence(memory_order_release) 与使用memory_order_acq_rel 有什么不同? - Is atomic_thread_fence(memory_order_release) different from using memory_order_acq_rel? atomic_thread_fence(memory_order_seq_cst) 是否具有完整内存屏障的语义? - Does atomic_thread_fence(memory_order_seq_cst) have the semantics of a full memory barrier?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM