Re: Cleanup for thread local storage?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Stephen Spackman wrote:

> It's important because one of the things that TLS is nice for is
> optimizations like per-thread task queues and free lists, but a
> *reliable* mechanism is needed to release their contents on thread exit,
> and it really *should* be bound to the variable declaration point
> itself, or many of the benefits of TLS are lost.

We use thread-local-storage quite a bit in Asterisk, but we (for the
reasons you mention) don't use GCC's version of it, we use the direct
pthread library calls for allocating and freeing TLS keys. These keys
have destructor callbacks, so we have complete control over the TLS
object lifetimes.

-- 
Kevin P. Fleming
Director of Software Technologies
Digium, Inc. - "The Genuine Asterisk Experience" (TM)

[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux