Wednesday 25 May 2011

Developer Journal 86 - On Boost Serialization


I'm still working on serialization. I've found out that there is no problem when I serialize a synapse by itself. The problem seems to be when I serialize the synapses along with other things.

Nope, I was wrong. I serialized a vector of 100 synapses and the program crashed.

I serialized a vector of 0 synapses. No crash.

I serialized a vector of 1 synapse. No crash.

I serialized a vector of 2 synapses. No crash.

I serialized a vector of 64 synapses. Crash.

I serialized a vector of 32 synapses. Crash.

16 synapses. Crash.

8 synapses. No crash.

12 synapses. Crash.

10 synapses. No crash.

11 synapses. No crash.

Strange. On my home machine, linking takes about 30 seconds. On my uni machine, linking takes about 71 seconds. The reason it matters is that the compilation step on my uni machine takes about 70 seconds as well. All together, that's about 140 seconds, almost three minutes each time I make even a small change.

So I can happily serialize a vector of 0 to 11 synapses. Great.

The crash occurs when synapse serialization calls the parent serialization function.

No crash occurs when I don't make class Synapse inherit from class Obj. But serialization works for other classes that inherit from class Obj.

RELATED

No comments:

Post a Comment