|
Boost Users : |
Subject: Re: [Boost-users] Thread safety in Boost msm
From: Christophe Henry (christophe.j.henry_at_[hidden])
Date: 2013-02-18 16:34:50
>Hi,
>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.
>Thanks,
>Soumya P. Ukil
Hi,
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.
HTH,
Christophe
Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net