TLS limitations

Jakub Jelinek jakub@redhat.com
Wed Feb 13 14:44:00 GMT 2002


On Wed, Feb 13, 2002 at 01:50:34AM -0800, Ulrich Drepper wrote:
> I forgot to point out the "limitations" of the implementation.
> 
> The dtv includes a generation counter.  This value must be compared
> with < not only !=.  The type for this element is size_t.  This means
> that the counter can "only" be increment 2^32 times before it leads to
> problems.  And there will be problems if this should happen.
> 
> The counter is incremented whenever an object (or any of its
> dependencies) uses TLS and is loaded or unloaded.  I do think it is
> reasonable to assume that 2^32 load and unload operations are enough
> even if the process runs for years.  Note, objects without TLS
> requirement have no influence.

Well, a dlopen/dlclose in a cycle could trigger it in a day or so
on current systems, but that's certainly not a reasonable program.

	Jakub



More information about the Libc-hacker mailing list