View Issue Details

IDProjectCategoryView StatusLast Update
0000048LDMud 3.5Runtimepublic2009-01-08 07:10
ReporterlarsAssigned To 
PrioritynormalSeverityfeatureReproducibilityN/A
Status newResolutionopen 
Summary0000048: Use Root-Pointer table to avoid swapping objects during GC.
DescriptionInstall a root-pointer table (hashed over the pointer targets) in which every entry has a refcount and a pointer to the associated target.

For every entity referenced from a swapped out object (strings, mappings, vectors) establish a root-pointer entry pointing to the entity. The refcount counts how many of such external references exist to the entity.

This way during a GC it is no longer necessary to swap in all objects just in order to count the references - reducing the time and memory needed, and reducing the fragility of the GC process.
TagsNo tags attached.

Activities

lars

2004-04-04 01:34

reporter   ~0000045

Instead of 'root pointer' this should be called 'proxy'.

The module would offer two main methods:

proxy_t * handoff_ref (void * entity, int entity_type)

  Hand the ownership of the reference to <entity> over to the proxy table, and receives the pointer to the proxy responsible in return.

void * retrieve_ref (proxy_t * root_ptr)

  Retrieve the ownership of the reference to <entity> from the named proxy. The returned pointer to the <entity> can be different from the pointer the proxy was created for.

For this to work, the proxy_t would have to store the hash index in the proxy table.

-------------

This approach offers another benefit: once the proxy holds the only remaining reference to the entity, the entity could be swapped out. This way the complexity of the variable swapping in the swapper could be reduced, and at the same time more data becomes eligible for swapping. This could even be generalized to the normal program swapping.

Problematic however would be mappings (object/closure keys can get stale or require resorting), and maybe alists. Such entities would have to have a flag or special type (T_MAPPING | T_MOD_REF) so that the GC knows that it would have to swap these entities back in in order to remove the references to destructed objects. Without entity-swapping this wouldn't be a problem as such entities would stay resident (the swapper refuses to swap them out even if there is just one ref left).

Things to check first, before implementing the swapability: how many proxies would there be in a normal mud, and how many of these would be eligible for swapping? Also, add a time measurement to the GC.

lars

2004-05-10 10:20

reporter   ~0000059

In order to do this, the program structure should be split into two parts (header and dynamic data) - this is already a TODO in exec.h .

lars

2004-05-10 10:33

reporter   ~0000060

The proxy module should also keep condensed string_t* and struct_type_t* tables, referenced from program_t* structures, to keep track of function names (always tabled) and structure references from swapped-out programs. Using the generic proxy types for this would incur too much overhead.

Issue History

Date Modified Username Field Change
2004-04-03 10:09 lars New Issue
2004-04-04 01:34 lars Note Added: 0000045
2004-05-10 10:20 lars Note Added: 0000059
2004-05-10 10:33 lars Note Added: 0000060
2009-01-08 07:10 zesstra Project LDMud 3.3 => LDMud 3.5