Supporting emulated tls

Johannes Pfau nospam at example.com
Wed Mar 21 06:17:03 PDT 2012


Am Mon, 19 Mar 2012 16:14:36 +0000
schrieb Iain Buclaw <ibuclaw at ubuntu.com>:


> 
> Initial things to think about on the top of my head:
> 
> * Speed to access symbols.

It needs the normal code to access the TLS struct / get the address of
the TLS struct + one add instruction which adds the offset for the
specific variable. So it should be fast enough.

> * Accessing thread local symbols across modules.

Do we have to use module-local symbols? If we could use symbols with
unique, mangled names, we could just access that symbol+offset from
every module. This assumes the d/di files provide enough information to 
calculate the offset.

> 
> > Just to clarify: 'module-level' as in D module(/object file) or as
> > in one variable per shared library/application? If we can support
> > one variable per shared library/application that'd be great, as we
> > will then only have a few tls ranges for the gc.
> >
> 
> Per module - see the code that initialises _Dmodule_ref.  We're really
> just adding two extra fields to that which includes starting address
> and size.
> 


More information about the D.gnu mailing list