Should there be a mutex for every setter in a class or making all member variables atomic to be threadsafe?

后端 未结 0 1578
暖寄归人
暖寄归人 2020-11-30 13:07

I\'m writting a class which has lots of set-able variables. The requirement is now that class should be thread-safe.
So my options as far as I know is to use mutexes

相关标签:
回答
  • 消灭零回复
提交回复
热议问题