|
Boost : |
From: Alexander Terekhov (terekhov_at_[hidden])
Date: 2003-02-24 07:52:19
Ken Hagan wrote:
>
> Alexander Terekhov wrote:
> >
> > I, for one, believe strongly that "&k" is nothing but
> >
> > "static_cast<typeof(k)*>(pthread_getspecific(__k_key));"
> >
> > It *isn't* a compile-time constant (just like &errno isn't a compile
> > time constant).
>
> MSVC has no pthread_getspecific(), so I venture to suggest that
> your belief probably isn't valid for that compiler.
Uhmm. In return, I venture to suggest that MS-TLS can and shall be
characterized as ``utterly busted.''
"If a DLL declares any nonlocal data or object as __declspec(thread),
it can cause a protection fault if dynamically loaded."
Well, let me put it this way: basically, MS-TLS implements the
"static" model of ELF-TLS.
http://people.redhat.com/drepper/tls.pdf
regards,
alexander.
-- "There's really nothing special about ELF (or Tru64) TLS. It's just TSD with a different key space (your dtv array index, or in our case literally a separate TSD key space mapped into the same TCB vector). __tls_get_addr is just pthread_getspecific() with the allocation and initialization of a TSD value built in (because it can find the size and an initialization template automatically). It's nice to have that built in to the compiler and linker, but that's a convenience and nothing radically different." -- Butenhof [http://tinyurl.com/3047]
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk