Currently, the serialization library cannot be considered thread safe. It turns out that there are some shared static variables associated with type tables. These tables could change at run time. If using multiple archives simultaneously in different threads there could be a race condition. Its possible that that in a particular program no such condition would/could ever arise and it would be safe. But in general that could not be guarenteed. The next version currently on the branch "serialization_next_release" addresses this situation in a definitive way. I would expect to see this enhancements to be part of boost 1.36 Robert Ramey Ruediger Berlich wrote:
Hi there,
I remember that, a few months ago, there was a discussion that Boost.Serialization was currently only thread-safe when using g++ . I cannot find any specific information on this topic, however.
I have distinct objects, each of which is serialized in its own (boost) thread and then sent over a network connection and deserialized at the other end.
Seems to work fine, without synchronization between different serialization calls.
I am using Boost 1.34.1 with Asio 0.3.8, together with threadpool 0.2.4. This is on an OpenSuSE 10.3 box with g++ 4.2.1 .
Will I run into trouble when I port this to other compilers + platforms ?
Thanks and Best Regards, Ruediger