-
Notifications
You must be signed in to change notification settings - Fork 24
Thread Safety
Sergei Fedorov edited this page Nov 30, 2016
·
1 revision
The afsm
-based state machines can be completely thread-safe when needed and can accept events from multiple threads guaranteeing consistent order of event processing. When thread safety is not required you don't have to pay for the overhead introduced by locking mutexes.
Given a state machine definition my_fsm_def
we can instantiate thread-safe and non-thread safe state machines the following way:
// Non-thread safe SM
using my_fsm_st = ::afsm::state_machine<my_fsm_def>;
// Thread-safe SM
using my_fsm_mt = ::afsm::state_machine<my_fsm_def, ::std::mutex>;
TODO Traits for supporting different kinds of mutexes.
- Home
- Tutorial
-
Concepts
- State Hierarchy
- Entry/Exit Actions
- Transition Actions
- Transition Guards
- Internal Transitions
- Default Transitions
- Event Deferring
- History
- Orthogonal Regions
- Event Priority
- Common Base
- Thread Safety
- Exception Safety Guarantees
- Under the Hood
- Event Processing
- Performance