Proxying object memory for synchronous update.

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Chris McCormick

    #1

    Proxying object memory for synchronous update.

    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.

    -------------------
    chris@mccormick .cx

Working...