Array marking

Corey Minyard minyard@acm.org
Mon May 1 09:31:00 GMT 2000


Corey Minyard <minyard@acm.org> writes:

> "Boehm, Hans" <hans_boehm@hp.com> writes:
> > Do we know that if a class becomes unreachable and its loader is
> > unreachable, we can't still be executing a static method in the class?  If
> > not, then unloading the .so is not safe.
> 
> This is not insurmountable.  When a static method was called, the
> compiler could throw a reference to the class onto the stack as part
> of the call sequence or part of the method initialization.  This would
> add some overhead, but not a lot, and only for static methods.

I thought about this some more and realized this is not a workable
solution.  The trouble is how will the class's object be found?
However, the situation is not as bad as that.  If a class uses another
class, it should have a reference to it somewhere.  This would avoid
the problem of the static methods completely (since the calling class
would have to exist and would have a reference).  Of course, there are
still finalization issues.

Corey


More information about the Java mailing list