>Well, the main problem is that a call to pth_key_delete() is only
>valid after clearing (with "pth_key_setdata(..., NULL)") the data
>corresponding to this key in *all* threads. Just clearing the key 
>in the *current* thread is not sufficient.

        I believe the pth_key_***()  APIs are used for "thread 
local storage". So does it really matter whats the data value 
for this key in other threads ?. Please correct me If I am wrong.

        I think it would be great if the documentation for Pth 
<http://www.gnu.org/software/pth/pth-manual.html> 
could explain something about what all the application 
should do before destroying a private key.

> Additionally to clearing the data, the corresponding destructor
>has to be called first, too.

        I think pth_key_delete() is used to destroy only
a *single key* and not to free the complete memory allocated for 
storing the private data values for a thread. So is it required to call
the destructor function from a pth_key_delete () ?


>The question just is: should pth_key_delete() return with e.g. EBUSY
>in case any thread still uses data associated with the key or should
>it instead automatically free all the data associated with it in all
>threads. I personally think pth_key_delete() should return EBUSY. 
>Any objections?

        I think the pth_key_delete() should be a little more intelligent
rather than asking the application to handle such conditions.  Or does 
current implementation of these APIs restricts *a thread* from 
freeing only a specific key. If that is the case then I think the 
pth_key_delete() should return EBUSY.


PS: I am not able see the mails posted after "10/08/2004" in 
the Pth mailing list archives.
<http://www.mail-archive.com/[EMAIL PROTECTED]/maillist.html>.
Does anyone else in this group is facing this problem ?


Regards,
Vinu V

______________________________________________________________________
GNU Portable Threads (Pth)            http://www.gnu.org/software/pth/
Development Site                      http://www.ossp.org/pkg/lib/pth/
Distribution Files                          ftp://ftp.gnu.org/gnu/pth/
Distribution Snapshots                 ftp://ftp.ossp.org/pkg/lib/pth/
User Support Mailing List                            [EMAIL PROTECTED]
Automated List Manager (Majordomo)           [EMAIL PROTECTED]
-----------------------------------------------------------------------------------------------------------------------------
Disclaimer
-----------------------------------------------------------------------------------------------------------------------------

"This message(including attachment if any)is confidential and may be privileged.Before 
opening attachments please check them
for viruses and defects.MindTree Consulting Private Limited (MindTree)will not be 
responsible for any viruses or defects or
any forwarded attachments emanating either from within MindTree or outside.If you have 
received this message by mistake please notify the sender by return  e-mail and delete 
this message from your system. Any unauthorized use or dissemination of this message 
in whole or in part is strictly prohibited.  Please note that e-mails are susceptible 
to change and MindTree shall not be liable for any improper, untimely or incomplete 
transmission."

-----------------------------------------------------------------------------------------------------------------------------

Reply via email to