On 13.05.2014 14:20, Wyatt wrote:
On Tuesday, 13 May 2014 at 06:06:40 UTC, Rainer Schuetze wrote:

This comes up from time to time, but to me it is very blurry how this
can work in reality.

The paper I linked on Friday [0] presents a collector like this. Are
there concerns I've missed that make that not applicable?

I just read the first chapters, and according to that, existing local gcs needs write barriers, so we are back to my second proposal. The implementation in the paper even adds read barriers.


Considering how "shared" is supposed to be used to be useful (do some
locking, then cast away "shared") there is no guarantee by the
language that any object is actually thread local (no references from
other threads). Working with immutable (e.g. strings) is shared by
design.

I'm not seeing much in the documentation, but from what I can tell (per
the FAQ), shared in D just guarantees it's on the global heap?

To me, shared is a type modifier that doesn't implicitely convert to anything else without casting. If a global/static variable is shared, it is placed into the data segment of the executable image, not TLS. The heap is not involved here.


-Wyatt

[0]
https://research.microsoft.com/en-us/um/people/simonpj/papers/parallel/local-gc.pdf

Reply via email to