boostorg / boostorg/statechart
Buffering of events - to make it threadsafe
- Dominant language
- C++
- Stars
- 32
- Forks
- 43
- PR merge metrics
- No merged PRs in 30d
Description
I am trying to familiarize myself sc, however I keep ending up with issues.
I have multiple threads that generate events and I am trying to buffer the events in a std::queue and have a thread call process_event with whatever is in the queue.
```
//typedef
typedef boost::statechart::state_machine::event_base_type VSEvent;
--
//queue def
std::queue> events;
--
//enqueue function
void HandleEvent(std::shared_ptr e);
```
Does this approach make sense at all - any references to thread safety would be great.
Besides, getting interactions with the outside world from the states seems non trivial. I have a static struct with thread safe getters and setters at the moment.
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.