作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我是 boost 元状态库的新手。我正在构建一个应用程序,我必须在其中使用 msm。
我的应用程序有两个线程,它们使用相同的 msm 对象作为共享资源。如果两个线程都在同一个 msm 对象上调用 process_event,那么 msm 是否是线程安全的?
欢迎任何想法。
最佳答案
引用 Christophe Henry,当您在 Boost.Users 列表中提问时他回答了这个问题:
msm is as thread-safe as a STL container: it's not. Different threads should not call process_event on the same state machine object. This means you'll have to serialize your calls to the object through a synchronization mechanism.
关于boost - Boost msm 中的线程安全,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14931691/
我是一名优秀的程序员,十分优秀!