Garbage Collection Issue

IGotD- nise at nise.com
Mon Jun 1 10:51:20 UTC 2020


On Sunday, 31 May 2020 at 16:57:06 UTC, Steven Schveighoffer 
wrote:
>
> I can't imagine much of druntime working at all without TLS. 
> Indeed, it is a requirement these days.
>
> I believe that's where these roots are being stored.
>
> -Steve

I would really like if druntime could remove its TLS variables as 
much as possible. TLS is really a complicated solution underneath 
and druntime makes it even more complicated. It requires a hook 
in thread creation since the raw TLS specification only applies 
simple variables that can be initialized using memcpy/memset. Any 
thread that is created outside the druntime will fail if D 
supports "complex" TLS variables.

TLS variables are also slower that normal variables since it 
often requires a system call in order to obtain the variable.

druntime should use stack variables much it can and/or shared 
variables.

If you ever encounter a TLS variable which is global variable in 
D, try to see if you can solve it with a stack or shared variable.





More information about the Digitalmars-d-learn mailing list