Re: [Boost-users] Boost serialization : concurrency
Daniel F. Savarese wrote:
In message <1DDB0D3CC4E7F14FAE946361C0A606550143CA11@isr-jlm-mail.Kayote.com>, "Moshe Matitya" writes:
I want to thank you guys for spending time on this. I know it's time consuming and you have other things to do. I'm watching the discussion in the hope that a consensus will be achieved and I can just update i/oserializer with the conclusion. If you made a simple - reliable test case, I would consider adding it to the test suite as this aspect of the library is important to me. However, I realize that that might not be possible. And compromises - like presuming that no de-serialization occurs before main is called are very acceptable to me - given the alternatives. Note that the order of creation is related to the fact that we use this idiom - instantiation via the usage of static variables - in several places. On is to instantiate serializers for derived classes (later) and one for maintaining the global table of types that the system knows about (sooner) Maybe that is helpful. Robert Ramey
On 9/18/06, Robert Ramey
Daniel F. Savarese wrote:
In message <1DDB0D3CC4E7F14FAE946361C0A606550143CA11@isr-jlm-mail.Kayote.com>, "Moshe Matitya" writes:
I want to thank you guys for spending time on this. I know it's time consuming and you have other things to do. I'm watching the discussion in the hope that a consensus will be achieved and I can just update i/oserializer with the conclusion.
Is there a reason we can't use Boost.Threads call_once()? Tony
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
"Gottlob Frege"
On 9/19/06, Robert Ramey
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/fb... Tony
participants (2)
-
Gottlob Frege
-
Robert Ramey