From: David Abrahams (dave_at_[hidden])
Date: 2003-03-29 10:15:46
"William E. Kempf" <wekempf_at_[hidden]> writes:
> Russell Hind said:
>> I'd been wondering this, and heard about TLS issues. The issues are
>> only on Windows it appears. Search for the thread
>> "Fwd: Thread-Local Storage (TLS) and templates" by Greg Colvin on
>> Specifically, the many posts by William Kempf and Edward Diener discuss
>> the problems on windows with TLS cleanup.
>> I do have a question on this issue: If this problem is only to do with
>> TLS cleanup when a thread exits, then if all threads are created when
>> the program starts and only destroyed when the program exited, then, in
>> practice, could this really be an issue? I.e. if we only work like
>> this, could building thread as a static lib cause problems providing
>> that we don't let threads exit in the middle of the program? We're
>> currently really trying to stay clear of any DLLs.
> Theoretically at least, I don't see why this would cause a problem. You
> intentionally leak, but the leak is benign since it occurs only right
> before the application exits. But most users won't code this way, nor do
> I want to have to deal with the support requests/questions this would
> cause. So, unless you have some suggestion as to how I can enable this
> usage with out causing confusion, I'm not sure I'd care to re-enable
> static builds. But you could probably fairly easily hack things to build
> that way yourself.
I don't really understand the issues here, but I was wondering if you
could reclaim "leaked" TLS resources lazily somehow, by looking for
unused TLS the next time new TLS is requested. Just a thought...
-- Dave Abrahams Boost Consulting www.boost-consulting.com
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk