[DGD] Keeping track of clones

Petter Nyström md1pette at mdstud.chalmers.se
Thu Aug 25 14:47:01 CEST 2005


I have a somewhat working object daemon that helps me doing things like 
recompiling inherited code on the fly and that sort of thing. It works 
most of the time. For some time I have been thinking of doing what people 
have told me is a good idea, but what I have not come around to do yet. 
Namely keeping track of all clones of a certain program. Could someone 
tell me what is their idea of the best way of doing this? I have three 
alternatives so far:

1. Keeping a separate data structure, i.e. a mapping with program names 
mapped to (potentially very large) arrays of living clones of that 
program.

2. Using the objects themselves as linked lists, i.e. letting the master 
object have an object pointer to the first clone and the first clone a 
pointer to the second clone, etc.. (Should also keep pointers to previous 
clones for easier manipulation of the list.)

3. Not using any additional data at all, but instead use the find_object() 
kfun. Since I know how many objects that are loaded, I would loop through 
all possibilities looking up (for example) /foo/bar#1, /foo/bar#2, etc. 
with find_object(). I figure this could be really slow if I have many 
objects loaded, but then I don't think I would need this sort of list 
other than when upgrading code and I could live with some delay for doing 
that.

I'm interested in knowing if there are other approaches, and what approach 
would be "best".

Thanks,

Jimorie



More information about the DGD mailing list