Boost logo

Boost Users :

From: Gottlob Frege (gottlobfrege_at_[hidden])
Date: 2006-09-20 15:52:08


On 9/19/06, Robert Ramey <ramey_at_[hidden]> wrote:
>
> I'm wouldn't want anyone using Boost Serialization to have to bring
> threading into his program just for this.
>
> I'm convinced that here is a fix which makes the code multi_thread safe
> without this.
>
> Robert Ramey
>

Well I'm not following the particular case well enough, but I'm pretty sure
in the general case, there is no fix without using some sort of threading
library.

However, for most systems, you CAN assume that all global inits are done
before main AND before additional threads are created. So in those cases a
mixture of static-local and startup-init-dummy works. For the other
systems, well, you just have a caveat that you can't use serialization
during static-init with multiple threads, without some user intervention.
If the user is doing threads during static init, then can probably handle
the problems that result.

you might want to check out the 'Threadsafe Singleton' thread in
comp.programming.threads:

http://groups.google.com/group/comp.programming.threads/browse_frm/thread/fb87ab5c130c6331/a7f96b49cb4d2ce5?lnk=raot

Tony



Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net