emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: MPS GC and its implications


From: Andrea Corallo
Subject: Re: MPS GC and its implications
Date: Thu, 02 May 2024 17:25:27 -0400
User-agent: Gnus/5.13 (Gnus v5.13)

Helmut Eller <eller.helmut@gmail.com> writes:

>>> I'm not sure what is with the buffer case, but the string case means
>>> that source can point to string data, which is in our MPS leaf_pool. I
>>> think we cvould use an exact scan function for that purpose, analogous
>>> to scan_specpdl. WSYT?
>>
>> If this is indeed needed, we are in trouble.  When we take a C pointer
>> to buffer or string text and use it in the following code, it's
>> because there's a hidden assumption that GC cannot happen during the
>> time the C pointer is being used.  If this assumption is not true with
>> MPS, nothing in Emacs will work reliably.
>>
>> Is this indeed a problem?  Didn't Gerd just explain to Andrea that
>> every object referenced from the stack or even from a register will be
>> automatically "fixed" if GC happens and decides to move the objects?
>> If so, why doesn't that solve the problem here?
>
> The stack and registers are ambiguous roots.  The objects they point to
> are "pinned" i.e. not allowed to move.  So as long as we keep a pointer
> in a local variable, things should work out fine.

[...]

>
> I think MPS is a concurrent GC, it means it runs "all the time".  The
> reason why his works are the memory barriers.  But maybe Gerd knows how
> things actually work.

It is still very unclear how it can move objects "all the time".  During
execution traced objects can be loaded on the stack and unloaded all the
time (Eli showed other examples of that) so I don't see ATM how it can
move objects without actually pausing the mutator thread.

  Andrea



reply via email to

[Prev in Thread] Current Thread [Next in Thread]