Add mutexs in Problem
The SolverManager
and the different wolf processors can be running in different threads.
The conflicts between the processors threads should be properly studied. It is quite tricky, basically all possible conflicts occur in keyFrame creation.
This issue is focused in the interaction between the processors and the SolverManager
. The main shared elements that should be protected are in Problem
:
StateBlockPtrList state_block_list_;
std::map<std::pair<StateBlockPtr, StateBlockPtr>, Eigen::MatrixXs> covariances_;
std::map<FactorBasePtr, Notification> factor_notification_map_;
std::map<StateBlockPtr, Notification> state_block_notification_map_;
A rigorous analysis should be done to ensure that WOLF is thread safe. For now, a mutex will be added in Problem
, it will be locked in all member functions that involve any of these four attributes.