2

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.

Justin
  • 24,288
  • 12
  • 92
  • 142

1 Answers1

8

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.

Marshall Clow
  • 15,972
  • 2
  • 29
  • 45