Thanks a lot for your input. We will investigate this further and test the different scenarios. I will return with some conclusions later (after the summer holidays) Sigurd Saue -----Opprinnelig melding----- Fra: boost-users-bounces@lists.boost.org [mailto:boost-users-bounces@lists.boost.org]Pa vegne av Robert Ramey Sendt: 29. juni 2006 17:57 Til: boost-users@lists.boost.org Emne: Re: [Boost-users] Is serialization thread safe? Sigurd Saue wrote:
We use boost serialization for sending notifications from a server to multiple clients. The problematic scenario is when two client threads within the same process deserializes the same notification. In your words: the same archive into different object from different threads.
Hmm this same archive or same archive instance? In any case I believe the following should work and would be very interested in knowing that it doesn't. If it doesn't work, I would be very interested in knowing where the problem arises. std::ifstream is1("file); boost::archive::text_iarchive ia1(is1); std::ifstream is2("file); boost::archive::text_iarchive ia2(is2); // from thread one object o; ia >> o // from thread two object o1; ia1 >> o1; Of course if the archives or their input streams are shared among threads this can't work as the state of both the archives and streams are changed by the action of deserialization. Robert Ramey _______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users