Boost logo

Boost :

From: Robert Ramey (ramey_at_[hidden])
Date: 2005-08-19 02:00:42

David Abrahams wrote:

>>> If, for all appearence, I don't
>>> use the same object in two threads, but there's some *internal*
>>> shared data structure, it should be protected *internally*. In this
>>> case, there's some internal serialization table that I know nothing
>>> about, so it should be protected by serialization library.
>> Repeat, I don't think this is necessary.
> Why not? Is there no mutation at all?

a) Mutation can only occur when a DLL is loaded or unloaded.
b) Archive code presumes that the set of known types does not vary between
the time an archive is created and the time it is destroyed.
c) Ergo, protecting access to these tables with something like a mutex won't
be effective in enforcing b)
d) So there is no reason to implement it.

> All I can say is that serialization and concurrency are natural
> partners, since serializing/deserializing is commonly used for
> interprocess communication. Whether it will apply to threads, I can't
> say.

No problem here. The problem is dynamic loading and unloading of DLLS which
contain serialization code. This has nothing to do with the common usage
you describe above.

Robert Ramey

Boost list run by bdawes at, gregod at, cpdaniel at, john at