Island globals not serialized by TIslandReader???

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Island globals not serialized by TIslandReader???

Joshua Gargus
Subject says it all, really.  I stashed an object from within the  
island using #at:.  When I saved the island as a .c3d file and  
reopened it, the global wasn't restored.

Is this a bug?  Desired behavior?  Am I missing something?

Thanks,
Josh


Reply | Threaded
Open this post in threaded view
|

Re: Island globals not serialized by TIslandReader???

Andreas.Raab
You are probably missing something since AFAICT this all works just fine
(if it didn't none of the demos would work since they all store their
viewpoints in that place and they all get written to and reloaded from
disk). My  guess is that perhaps you're doing something like here:

        "... some time earlier ..."
        island future at: #foo put: <something>

        "... and then some time later ..."
        data := controller snapshot.

The reason this may not work is that the message may not have been
executed when you do the snapshot (e.g., it may still be in transfer on
the wire). In general, you should prefix all snapshots with a "sync"
like here:

        sync := island future yourself. "any message will do"
        sync wait. "all messages up to sync have been executed"
        controller snapshot.

This ensures that all the messages this participant has sent have been
executed before the snapshot (and consequently requires a network
roundtrip).

Cheers,
   - Andreas

Joshua Gargus wrote:

> Subject says it all, really.  I stashed an object from within the island
> using #at:.  When I saved the island as a .c3d file and reopened it, the
> global wasn't restored.
>
> Is this a bug?  Desired behavior?  Am I missing something?
>
> Thanks,
> Josh
>
>
>