Boost logo

Boost Users :

Subject: Re: [Boost-users] [Serialization] Is this example legal usage of the serialization library
From: Robert Ramey (ramey_at_[hidden])
Date: 2010-08-26 16:31:08

elizabeta petreska wrote:
> Hi ,
> Thanks for the explanation, and for the great library.
> I never thought about that, that the pointer may be referenced by
> other objects, or maybe refering to some derived object.
> Here is why I want to do that :
> I have project saving/loading feature implemented with boost
> serialization library. As part of my project saving , I need to save
> state for the dockbar controls too ( things like are buttons enabled
> or disabled).
> But because the saving and loading is on different thread I just
> can't say :
> ar<< dockBarPtr;
> because than the serialization library will create my dockbar widget
> in thread other than the main thread which is error.

I don't see how doing ar << *dockBarPtr would address this.

I'm guessing that this is a windows program as I've had similar problems.
I ended up creating a custom windows message. I post the message to
the main window. When the UI thread gets the message, it does serialization
or whatever you want on the UI thread. Of course this has nothing to
do with serialization.

> So far I am doing this and everything works fine, but I was afraid
> that am doing something prone to error, which is true, as I suspect .
> I guess it is time to rethink this

yep - that's why we get paid the big bucks.

Robert Ramey

Boost-users list run by williamkempf at, kalb at, bjorn.karlsson at, gregod at, wekempf at