; extragc.asm

; module for external inter-system garbage collection.

IF 0
  for tree-like inter-system garbage dependencies, the usual system
is just ok: "external markers" declare their death to the external
world.
  But when there are circular dependencies, or when pointers were "lost"
(buy a power-down somewhere or some other failure), unuseful data can stay
and accumulate even though it's just garbage.
  Then we need some global garbage collection.
  It can itself be run hierarchically, so that we have subsystems with
good independency run it internally independently from the rest of the
world.


  Algorithm:
* External GC are run on a regular rendez-vous basis (for example once
 every night on a lan, every sunday on a big net such as internet, on a
 monthly basis (first sunday of each month, just after
* Black objects are objects that we know are needed.
* External Black objects are securely notified that they are still black, or
 that they are now white.
* Grey objects are objects that have a positive number of external counts,
 but no internal count, or objects that depend on such. They wait until they
 are made black (by an external notification), or the global process it
 finished.
* Another possibility for grey objects is to migrate to a client system and
 notify all other clients. The migration process(es) may be done independently
 from the external gc process, that's why I won't expand on this here.
* when everyone is waiting, the process is finished. To determine when the
 process is finished, one (or multiple servers) must be notified each time
 a system is waiting, and each time a system is sending a blackening message
 (a system must ensure the "blacken" message is received before it may go
 waiting). If broadcast is used on a net, each machine can be its own server
 with respect to this end-of-process thing.
* This can be hierarchically organized, of course, with subservers for each
 subsystem, which are notified for everything that happens internally, and
 that notify the superserver for everything that is done
 When the process is finished, the server notifies all the systems.
*  While this algorithm is run, no object should be falsely declared white, or
 forgot to be declared, else it will be destroyed. But new objects may be
 created, and others destroyed

ENDIF

Segment	Code
Proc	ExtraGC
	
EndP	ExtraGC
EndS	Code
