s*****g 发帖数: 323 | 1 thread-safe access to public member functions and variables在C++里是怎么写的?
我记得在java里,好像就是加一个synchronized.
在C++里,是不是也有类似的呢? | a****l 发帖数: 68 | | a****l 发帖数: 68 | | W*Z 发帖数: 10 | 4 I don't think there are any key words in C++ to support thread safe, however
, there are design and implementation rules to enforce thread safe while
writing C++ codes. It is not an easy topic, search online for various
discussions.
I think the key would be what is a valid state of an object and how to keep
it valid all the time.
【在 a****l 的大作中提到】 : 是不是要用mutex保护起来?
|
|