Boost logo

Boost Users :

Subject: [Boost-users] [msm] multi thread access
From: Sam Fisher (infest21h_at_[hidden])
Date: 2015-01-23 06:00:12

Hi Christophe,

Did you consider adding build-in multi-thread support? (via policies maybe?)

For example, I can guaranteed that all access to sub-fsm within its
handlers (process_event()) will be synchronized.
The problem is, sub-fsm "knows" about its parent and internally
communicates with it (forwarding events etc). I can't control it from my

typical scenario:
an action from sub-fsm

struct A_Init
   template <typename Evt, typename FSM, typename SourceState, typename
   void operator()(Evt&, FSM& fsm, SourceState&, TargetState&) const
     std::thread([=]() mutable
       std::lock_guard<std::mutex> l(access);

locking proccess_event() in sub-fsm doesn't help if it alters the root.

Boost-users list run by williamkempf at, kalb at, bjorn.karlsson at, gregod at, wekempf at