This is the mail archive of the
java-discuss@sourceware.cygnus.com
mailing list for the Java project.
Re: Array marking
- To: "Boehm, Hans" <hans_boehm at hp dot com>
- Subject: Re: Array marking
- From: Corey Minyard <minyard at acm dot org>
- Date: 01 May 2000 11:31:01 -0500
- Cc: "'Bryce McKinlay'" <bryce at albatross dot co dot nz>, Jeff Sturm <jsturm at sigma6 dot com>, java-discuss at sourceware dot cygnus dot com
- References: <140D21516EC2D3119EE700902787664456E7B4@hplex1.hpl.hp.com> <m2snw48ujm.fsf@c469597-a.grlnd1.tx.home.com>
- Reply-To: minyard at acm dot org
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