primitiveSetGCSemaphore puzzle

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

primitiveSetGCSemaphore puzzle

Igor Stasenko
 
I am a bit puzzled with this primitive.
There is no sender of #setGCSemaphore: semaIndex in image,

and VM seems like using it for signaling semaphore as a post-GC action.

I expected that it is finalization process, which should use that
guy.. but no, it just using special objects array indice:

restartFinalizationProcess

...
        FinalizationSemaphore := Smalltalk specialObjectsArray at: 42.
...

Apparentlly , each time we have GC, the finalization semaphore is signaled.

So, it makes me wonder, how it working because i see that VM signals
semaphore in postGCAction, which should be set by the mentioned
primitive.

--
Best regards,
Igor Stasenko AKA sig.
Reply | Threaded
Open this post in threaded view
|

Re: primitiveSetGCSemaphore puzzle

johnmci

That is there to allow the Sophie Memory Policy to aggressively
collect statistical data after every scavenge so it could make
decisions about when to tenure everything to avoid excessive  remember
table scanning.
That or do a peek every N seconds.

You've noticed the low adoption rate.


On Wed, Aug 17, 2011 at 9:46 AM, Igor Stasenko <[hidden email]> wrote:

>
> I am a bit puzzled with this primitive.
> There is no sender of #setGCSemaphore: semaIndex in image,
>
> and VM seems like using it for signaling semaphore as a post-GC action.
>
> I expected that it is finalization process, which should use that
> guy.. but no, it just using special objects array indice:
>
> restartFinalizationProcess
>
> ...
>        FinalizationSemaphore := Smalltalk specialObjectsArray at: 42.
> ...
>
> Apparentlly , each time we have GC, the finalization semaphore is signaled.
>
> So, it makes me wonder, how it working because i see that VM signals
> semaphore in postGCAction, which should be set by the mentioned
> primitive.
>
> --
> Best regards,
> Igor Stasenko AKA sig.
>



--
===========================================================================
John M. McIntosh <[hidden email]>
Corporate Smalltalk Consulting Ltd.  http://www.smalltalkconsulting.com
===========================================================================
Reply | Threaded
Open this post in threaded view
|

Re: primitiveSetGCSemaphore puzzle

Igor Stasenko

On 18 August 2011 03:10, John McIntosh <[hidden email]> wrote:
>
> That is there to allow the Sophie Memory Policy to aggressively
> collect statistical data after every scavenge so it could make
> decisions about when to tenure everything to avoid excessive  remember
> table scanning.
> That or do a peek every N seconds.
>
Well, but doesn't it duplicating the Finalization semaphore?
It is also signaled when GC is performed.. so i don't see a reason to
signal same event twice by VM.

> You've noticed the low adoption rate.
>
>
> On Wed, Aug 17, 2011 at 9:46 AM, Igor Stasenko <[hidden email]> wrote:
>>
>> I am a bit puzzled with this primitive.
>> There is no sender of #setGCSemaphore: semaIndex in image,
>>
>> and VM seems like using it for signaling semaphore as a post-GC action.
>>
>> I expected that it is finalization process, which should use that
>> guy.. but no, it just using special objects array indice:
>>
>> restartFinalizationProcess
>>
>> ...
>>        FinalizationSemaphore := Smalltalk specialObjectsArray at: 42.
>> ...
>>
>> Apparentlly , each time we have GC, the finalization semaphore is signaled.
>>
>> So, it makes me wonder, how it working because i see that VM signals
>> semaphore in postGCAction, which should be set by the mentioned
>> primitive.
>>
>> --
>> Best regards,
>> Igor Stasenko AKA sig.
>>
>
>
>
> --
> ===========================================================================
> John M. McIntosh <[hidden email]>
> Corporate Smalltalk Consulting Ltd.  http://www.smalltalkconsulting.com
> ===========================================================================
>



--
Best regards,
Igor Stasenko AKA sig.
Reply | Threaded
Open this post in threaded view
|

Re: primitiveSetGCSemaphore puzzle

Andreas.Raab
 
On 8/18/2011 3:16, Igor Stasenko wrote:

>
> On 18 August 2011 03:10, John McIntosh<[hidden email]>  wrote:
>> That is there to allow the Sophie Memory Policy to aggressively
>> collect statistical data after every scavenge so it could make
>> decisions about when to tenure everything to avoid excessive  remember
>> table scanning.
>> That or do a peek every N seconds.
>>
> Well, but doesn't it duplicating the Finalization semaphore?
> It is also signaled when GC is performed.. so i don't see a reason to
> signal same event twice by VM.

The finalization semaphore is signaled for every object finalized. Very
different from signaling once on every GC.

Cheers,
   - Andreas