You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
So is it thread safe to load whole different archives on different threads. Is something preventing cereal to operate multiple archives in parallel? Please somene answer as i did not find apropriate answer for this
The text was updated successfully, but these errors were encountered:
No, sadly it is not. Cereal uses several StaticObjects which are not thread safe. For example the versioning-feature uses a static std::unorderd_map without a mutex.
We don't have the mutexes in place but it is easy to make cereal thread safe for cases like you describe by adding mutexes over the global objects. I believe there have been prior discussions on how to do this. Perhaps in a future release we can make a preprocessor option to compile in locks on these operations.
The current develop branch should be thread safe so long as each archive is only accessed by one thread, though you will need to ensure CEREAL_THREAD_SAFE=1 is defined (see cereal/macros.hpp). Documentation will follow shortly.
So is it thread safe to load whole different archives on different threads. Is something preventing cereal to operate multiple archives in parallel? Please somene answer as i did not find apropriate answer for this
The text was updated successfully, but these errors were encountered: