Am 07.04.2005 um 14:34 schrieb Jim Davidson:
Ugh -- this isn't good. In general, there is very little reason one should ever need to call pthread_delete_key -- that deletes the index in the per-thread slots where the pointer to the actual memory for each thread is held. The key itself is tiny, possible just a slot or two in static memory. While it's poss ible one could write super clean code that could carefully determine that no threads would ever access a slot again and enable a safe pthread_delete_key, in practice you can't guarantee that nor is there much value in an attempt. This is especially the case in environments like Tcl and AOLserver where folks are encouraged to link in their own code which can execute in any order.
It appears this code isn't in the HEAD version of Tcl -- it must have been sneaked into some branch.
Yep. In 8.4.6 to 8.4.7 it was attempted to make a clean unload of the Tcl library when somebody calls Tcl_Finalize(). Now, the Tcl finalization is by no means thread-safe. We have already discussed this issue some time ago if you rememeber. So, eventually, it was *assumed* that at Tcl_Finalize time no threads should be running hence it was safe to teardown sync primitives, tsd keys etc etc... Of course, this is by no means true in the current Tcl lib design.
Anyways, I have fixed the Tcl to accomodate the wish of unloading the Tcl lib and cleaning up all library resources engaged but w/o leaving the hole in the tsd management.
Zoran
-- AOLserver - http://www.aolserver.com/
To Remove yourself from this list, simply send an email to <[EMAIL PROTECTED]> with the body of "SIGNOFF AOLSERVER" in the email message. You can leave the Subject: field of your email blank.
