Shared

Jonathan M Davis newsgroup.d at jmdavisprog.com
Thu May 16 20:37:44 UTC 2019


On Thursday, May 16, 2019 2:04:13 PM MDT H. S. Teoh via Digitalmars-d wrote:
> On Thu, May 16, 2019 at 07:53:56PM +0000, Dominikus Dittes Scherkl via 
Digitalmars-d wrote:
> > On Thursday, 16 May 2019 at 17:29:25 UTC, Jonathan M Davis wrote:
> [...]
>
> > Ok, so then a shared object is in fact a specific memory segment. So
> > something the GC is already aware of. This makes implementing the
> > locking mechanism just more easy. We only need to prevent writing to
> > that address, no matter how many references are pointing there. And
> > that mechanism is well known in GC's - a write barrier.
>
> [...]
>
> D does not have write barriers, however. And it's unlikely to get one in
> the foreseeable future.

That and not all memory comes from the GC. It's perfectly legitimate to use
malloced memory with shared. The type system doesn't care where the memory
came from.

- Jonathan M Davis





More information about the Digitalmars-d mailing list