Some GC and emulated TLS questions (GDC related)

Johannes Pfau via Digitalmars-d digitalmars-d at puremagic.com
Sun Jul 16 07:10:45 PDT 2017


Am Sun, 16 Jul 2017 14:48:04 +0200
schrieb Iain Buclaw via Digitalmars-d <digitalmars-d at puremagic.com>:

> 
> I sense a revert coming on...
> 
> https://github.com/D-Programming-GDC/GDC/commit/cf5e9e323b26d21a652bc2933dd886faba90281c
> 
> Iain.

Correct, though more in a metaphorical sense ;-)

Ideally, I'd want a boost licensed, high level D implementation in
core.thread. Instead of using __gthread get/setspecific, we simply add a
GC managed (i.e. plain stupid) void[][] _tlsVars array to
core.thread.Thread, use core.sync for locking and core.atomic to manage
array indices. With all the high-level stuff we can reuse from druntime
(resizing/reserving arrays) such an implementation is probably < 100
LOC. Most importantly, as we can't overwrite the functions in libgcc
we'd also use custom function names (__d_emutls_get_address).

The one thing stopping me though is that I don't think I can implement
this and boost-license it now that I almost know the libgcc
implementation by heart...

-- Johannes



More information about the Digitalmars-d mailing list