[gclist] Death notices and more generalized notices.

Charles Fiterman cef@geodesic.com
Fri, 05 Oct 2001 10:39:19 -0500


Let us assume that a requirment of collectors is that the user can never
give them code to execute. The collector would be unable to verify what
environment the code required. If it looked at thread local storage it
couldn't verify it was in the right thread. If it threw an exception it
couldn't do anything rational with it. If it hung or crashed it might deny
service to a variety of users. This isn't just a general requirment of
collectors its a requirment of lots of servers. 

Often the server must give users notice of something. The act of giving
notice may not run user code. If the notice is placed in a collection it
can't be a general collection because general colletions can be pointed at
user written collections and the code to add a member will be user code.

Adding the notice to the collection should neither allocate storage or
throw an exception. Thus the collection should be something trivial like a
double linked list. The Java keyword final comes in handy here, it must be
a final double linked list not some class decended from it.

So the notice object needs a pointer to the collection "final" and giving
notice means adding the object to the collection "final". If the collection
is a double linked list adding to one list could automatically delete the
notice from any list its on. This would allow the user lists of waiting
notices.

Users can inherit from notice objects to add other stuff. They might add a
weak pointer at the object. The server might have a subclass of notice it
supported. For example there might be a time stamp notice which added a
time stamp and giving notice sets that. But the server would be able to
restrict what giving notice meant.