TSD destructors not being called for initial thread

Boris Kolpackov boris@kolpackov.net
Wed Mar 31 20:13:00 GMT 2004


Hi Kaz,

> What if your process crashes? What if something calls exit() and blows
> away all threads, or, equivalently, the main thread returns from the
> main function?
> 
> The TSD cleanup mechanism does not ensure that the functions are called
> no matter how the process terminates, so you can't rely on it for
> fail-safe cleanup of persistent resources.

I never said I want a fail-safe cleanup. The spec never said that I 
shouldn't use TSD destructors for releasing non-local resources. Spec
just said that at thread exit the TSD destructors are called. I am
free to use them no matter how stupid it may sound. Thus you cannot
decide for me.

BTW, one reason why you may want to release even process-local 
resources is to keep memory checkers calm.


hth,
-boris
 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 652 bytes
Desc: Digital signature
URL: <http://sourceware.org/pipermail/libc-alpha/attachments/20040331/bbfe0dac/attachment.sig>


More information about the Libc-alpha mailing list