Thread safety in Boost msm

两盒软妹~` 提交于 2019-12-11 03:02:31

问题


I am new to boost meta state library. I am building one app, where I have to use msm.

My application has two threads, where they use same msm object as a shared resources. Now will the msm be thread safe if both threads call process_event on the same msm object?

Any idea is welcome.


回答1:


Quoting Christophe Henry, who answered this when you asked it on the Boost.Users list:

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.



来源:https://stackoverflow.com/questions/14931691/thread-safety-in-boost-msm

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!