Per thread heap, GC, etc.

Markk markus.kuehni at triviso.ch
Fri May 14 17:22:34 UTC 2021


On Friday, 14 May 2021 at 16:11:26 UTC, H. S. Teoh wrote:

> However, there's a big caveat: sharing data between threads 
> would be essentially extremely broken.  Today, immutable can be 
> safely shared across threads, because well, it's immutable.  
> But once allocations are bound to a thread, this sharing would 
> be impossible without major problems.

No! I did not say this explicitly but of course `immutable` and 
`shared` remain the same. I was talking about heap memory.


>> I.e. all allocations would need to be per thread, and it would 
>> be illegal to reference memory of one thread's heap, static 
>> memory, or stack from another thread's memory.
> [...]
>
> Yeah, this would be a major bugbear for implementing it in D.

Compared to what for instance `@life` has to analyze, it is super 
easy, I think.

_Mark


More information about the Digitalmars-d mailing list