16

Serializing Serialization: How does pointer tracking work?

 3 years ago
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.
neoserver,ios ssh client

Serializing Serialization: How does pointer tracking work?

advertisements

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:

5ujQT.png

Starting with A, using a stack to determine what we still need to visit:

  1. Visit A
  2. Push B, C
  3. Pop and Visit C
  4. Push 'D'
  5. Something else deletes B and replaces it with D
  6. Pop and visit 'D'
  7. Pop and visit what was labeled as B, but is now really D 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?

I was wondering how animations work in Cocoa Touch. For example: [UIView beginAnimations:nil context:nil]; [UIView setAnimationDuration:1.0]; view1.alpha = 1.0; view2.frame.origin.x += 100; [UIView commitAnimations]; How does UIView tracks the change

How does Thread.Abort () work?

We usually throw exception when invalid input is passed to a method or when a object is about to enter invalid state. Let's consider the following example private void SomeMethod(string value) { if(value == null) throw new ArgumentNullException("valu

How does str (list) work?

Why does str(list) returns how we see list on the console? How does str(list) work? (any reference to the CPython code for str(list))? >>> x = ['abc', 'def', 'ghi'] >>> str(x) "['abc', 'def', 'ghi']" To get the original list ba

How does closing JavaScript work in this case?

How does JavaScript closure work in this case and to be more specific: what does the (i) at the end do? for(var i = 0; i < 10; i++) { (function(e) { setTimeout(function() { console.log(e); }, 1000); })(i); } Also I'm trying to implement it in my code

How does data binding work in AngularJS?

How does data binding work in the AngularJS framework? I haven't found technical details on their site. It's more or less clear how it works when data is propagated from view to model. But how does AngularJS track changes of model properties without

OCaml: How does List.fold_left work?

I'm trying to find the average of a list of floats. let avg l = List.fold_left ( +. ) 0 l /. List.length l;; How does List.fold_left work? (Applies the first argument to a list (the third arg)... but then what is the second argument?) Toplevel return

How does Angularjs routing work for non-browser applications?

I am creating a single page app (mobile/desktop) using AngularJS. Based on the limited knowledge I have of AngularJS, I think the routing for the apps/websites is based on urls and $location/$location.path directive is used. However, in mobile or des

How does Hello World work in Java without an instance of an object?

I'm a newbie to Java and I'm confused about something: In the simple hello world program in Java, no object is created so how does the class work in the following example? public class HelloWorld { public static void main (String args[]) { System.out

How does Wolfram Alpha work?

Behind the tables and tables of raw data, how does Wolfram Alpha work? I imagine there are various artificial intelligence mechanisms driving the site but I can't fathom how anyone would put something like this together. Are there any explanations th

How does incremental location work?

I'm trying to build my first localized application. I have all the strings in code translated using NSLocalizedString (for use with genstrings tool). Now I'm bumping into ibtool. How does incremental localization work? Regarding to the manual page, I

How does C # SortedList work in-house?

I was wondering, how does the SortedList work. I know that a regular List is based on a dynamic array, but what is SortedList based on? And what sorting algorithm it uses? ThanksFrom the sortedlist documentation: "SortedList is implemented as an arra

How does Meteor.isServer work in meteorological methods?

how does Meteor.isServer works in meteor methods? Apparently instead of putting my method definitions in the /server/methods, i could put it in /both/methods and use a Meteor.isServer. Does the code get called once in client and once in server? I'm a

How does this disorder work?

My Joomla! website has been repeatedly hacked into. Someone, somehow, managed to inject the following rubbish into the key php scripts, but I mean not to talk about configuring Joomla. The site is not visited much (at times I fear I might be the only

How does multiple inheritance work in Java?

This question already has an answer here: Java : If A extends B and B extends Object, is that multiple inheritance 10 answers Class Object is the root of class hierarchy. Every class has Object as a superclass. So, if I am extending a API class, will

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK