

Serializing Serialization: How does pointer tracking work?
source link: https://www.codesd.com/item/serializing-serialization-how-does-pointer-tracking-work.html
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

Serializing Serialization: How does pointer tracking work?
How does pointer tracking work in boost serialization? I am using it to serialize messages between system components, and I have the impression that I get a lot of incorrectly shared objects. Is it possible that if I use shared pointers to the objects I want to serialize and a new object happens to have the same address as a previous object that has since been deleted this will incorrectly be captured as a shared refernce?
Imagine the following for objects for serializing:

Starting with A
, using a stack to determine what we still need to visit:
- Visit
A
- Push
B
,C
- Pop and Visit
C
- Push 'D'
- Something else deletes B and replaces it with D
- Pop and visit 'D'
- Pop and visit what was labeled as
B
, but is now reallyD
as well
Then you have a situation that will incorrectly be captured as a shared reference. If anything can change any of the pointers, or objects they point to between the start of the serialization and the end of it then you'll get an inconsistent state.
Related Articles
How does [UIView beginAnimations] work?
How does Thread.Abort () work?
How does str (list) work?
How does closing JavaScript work in this case?
How does data binding work in AngularJS?
OCaml: How does List.fold_left work?
How does Angularjs routing work for non-browser applications?
How does Hello World work in Java without an instance of an object?
How does Wolfram Alpha work?
How does incremental location work?
How does C # SortedList work in-house?
How does Meteor.isServer work in meteorological methods?
How does this disorder work?
How does multiple inheritance work in Java?
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK