[vwnc] [VM geeks] Interaction of incremental GC with #isWeakContainer:

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

[vwnc] [VM geeks] Interaction of incremental GC with #isWeakContainer:

Martin McClure
The ability to turn weakness of a weak array on and off with
#isWeakContainer: appears to be a very useful feature. However, I'm not
clear on how this interacts with incremental GC.

The semantics I *want* are that if I send "isWeakContainer: false", then
from that moment any references I find in my weak array can be relied on
to stay there until I send "isWeakContainer: true".

It seems pretty clear that this will be true with respect to all the
atomic forms of GC. However, it seems possible that if an incremental
mark is underway, and has already put my weak array in its list of weak
collections at the time I send "isWeakContainer: false", then some
referenced objects might be collected and nilled as that GC completes.
That would cause problems for my application (distributed GC between VW
and GemStone).

Am I understanding this correctly? From reading the VM source it looks
like the primitive is just fiddling with the bits in the object header,
while it would have to do more to update the state of an incremental GC
in progress.

Is it enough to do this sequence?:

   myWeakArray isWeakContainer: false.
   ObjectMemory finishIncrementalGC.

After which any references that are still there are guaranteed to stick
around?

Thanks,

-Martin

_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc
Reply | Threaded
Open this post in threaded view
|

Re: [vwnc] [VM geeks] Interaction of incremental GC with #isWeakContainer:

Eliot Miranda-2


On Wed, Sep 3, 2008 at 6:47 AM, Martin McClure <[hidden email]> wrote:
The ability to turn weakness of a weak array on and off with
#isWeakContainer: appears to be a very useful feature. However, I'm not
clear on how this interacts with incremental GC.

The semantics I *want* are that if I send "isWeakContainer: false", then
from that moment any references I find in my weak array can be relied on
to stay there until I send "isWeakContainer: true".

It seems pretty clear that this will be true with respect to all the
atomic forms of GC. However, it seems possible that if an incremental
mark is underway, and has already put my weak array in its list of weak
collections at the time I send "isWeakContainer: false", then some
referenced objects might be collected and nilled as that GC completes.
That would cause problems for my application (distributed GC between VW
and GemStone).

Am I understanding this correctly? From reading the VM source it looks
like the primitive is just fiddling with the bits in the object header,
while it would have to do more to update the state of an incremental GC
in progress.

Is it enough to do this sequence?:

  myWeakArray isWeakContainer: false.
  ObjectMemory finishIncrementalGC.

After which any references that are still there are guaranteed to stick
around?

I think so.  The nilling of weak fields in the incremental collector is done in an atomic step (along with firing ephemerons) at the end of an IGC cycle.  So what you show above should work.
 


Thanks,

-Martin

_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc


_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc