Proxying object memory for synchronous update.

  • Thread starter Chris McCormick
  • Start date
C

Chris McCormick

Hi,

I'm looking for a solution to a concurrency problem I have. I would like
to have multiple objects with an Update() method. This Update method
might access the contents of other objects. I would like there to be a
proxy so that if object A's Update method is run before object B, and
object A modifies a few of it's own variables, arrays, whatever, then
when object B's Update is run and it tries to read object A's variables,
arrays or whatever, it gets the old values as if A's Update method had
not yet run. Once all of the update methods have been run on each object
(in an array), the actual values of each object's variables, arrays,
etc will be updated (possibly using another method). I'd like this to
be automatic so that i can just add a Mixin to a class to give it this
property, or a decorator or something.

I am thinking this might be possible to do using __getattr__ and
copy.copy() or pickle or something, but so far the solutions I have
tried don't work very well. they especially don't work if in the
situation where A has an array and it modifies an element of that
array (how would I proxy that access?).

Links, solutions, tutorials, whatever are very welcome.

Please reply to me off (and on) list as I am not subscribed.

Thank you very much for your help.

Best regards,

Chris.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Staff online

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,012
Latest member
RoxanneDzm

Latest Threads

Top