线程安全和`const` [英] Thread safety and `const`
本文介绍了线程安全和`const`的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
const
(指针,引用和成员函数)如何帮助C ++中的线程安全?
How does const
(pointers, references and member functions) help with thread safety in C++?
推荐答案
多线程的主要问题是可变性。 const限制了这一点,但是因为你可以抛弃常量,这不是万无一失。
The main problem with multiple threads is mutability. const restricts this, but since you can cast away the const-ness, it's not foolproof.
这篇关于线程安全和`const`的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文