What's the go with the GC these days?

H. S. Teoh hsteoh at quickfur.ath.cx
Mon Jan 7 21:06:22 UTC 2019


On Mon, Jan 07, 2019 at 03:28:26PM -0500, Steven Schveighoffer via Digitalmars-d wrote:
> On 1/7/19 2:52 PM, H. S. Teoh wrote:
[...]
> > I think what Neia has in mind, which he mentioned in another post,
> > is to have the druntime function simply pin the object, whichever
> > pool it belongs to.  The idea being to tell the respective
> > thread-local GC "this object might be referenced by another thread,
> > do not collect or move".
> 
> Imagine I have a shared piece of data, then I cast it to thread local.
> Now, it is able to point at thread local data, but it lives in the
> shared heap.  Pinned or not, this means a local collection must scan
> the shared heap to see if it can collect any thread-local data. This
> defeats the purpose of having a thread-local heap in the first place
> (which you should be able to scan without having to stop-the-world).
[...]

Hmph, good point.  That sux. :-(  I suppose that's where copying/moving
the object comes in -- migrate it to a different pool somehow so that we
can avoid stop-the-world.


T

-- 
They pretend to pay us, and we pretend to work. -- Russian saying


More information about the Digitalmars-d mailing list