开发者

How do I keep track of references in a distributed object graph?

I'm developing a distributed system, which must maintain a distributed object graph, where objects can point to other objects, some of which may be on remote computers. It must also be possible to move objects from one computer to another.

This raises two related problems:

  • How do we know when it is safe to garbage-开发者_StackOverflowcollect objects?
  • If we move an object, how do we robustly ensure that all references to it are updated?

An initial thought is to maintain an exhaustive list of all inbound references.

Of course, this alone isn't sufficient for garbage-collection, as it won't catch cyclic references (same problem as with reference-counting garbage collections).

However this list can be used to ensure that any remote computer with references to the object can be notified if the object is moved.

Another thought is that if an object is moved, it leaves behind a "breadcrumb" on its original computer. If a computer receives a message intended for an object that is no-longer present, it can be forwarded to its new location.

However it is not scalable to keep such references around indefinitely, how do we know when its safe to delete them?

Can anyone provide pointers to existing solutions to this problem, particularly those that deal with replication and concurrency issues too?


The most known solution in Java is implemented as part of the RMI spec.

See Garbage Collection of Remote Objects & Distributed Garbage Collection

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜