On Nov 20, 2007 5:14 PM, Gregory Shimansky <[EMAIL PROTECTED]> wrote:

> Rana Dasgupta wrote:
> >> On 11/20/07, Gregory Shimansky <[EMAIL PROTECTED]> wrote:
> >> This may be difficult to do in this implementation, since by the time
> the VM
> >> gets back control in the class unloading cycle, it is possibly too late
> to
> >> do this.
>
> >I think in case JVMTI is enabled, and agent requests this event to >be
> >supported it is possible to create a collection of weak references to
> >class objects. Once a weak reference is enqueued, VM would >send an event
> >to the agent, and it creates a strong reference, unloading shall
> >automatically be canceled. Otherwise the class would be unloaded >in the
> >normal way.
>

  I think this may be possible if, as you describe,the agent is signalled
and it makes the decision about about resurrecting the reference in time
order before VM hands off to GC. I don't really know JVMTI, is it possible
for there to be a race here since the agent thread is not suspended?


>
> --
> Gregory
>
>

Reply via email to