Re: Extended attributes and thread safety

Christiaan Hofman <[email protected]>
Newsgroups gmane.comp.macosx.devel
Message-ID <[email protected]>
On Aug 31, 2009, at 8:36, Chris Suter wrote:

> Hi Christian,
>
> On Sun, Aug 30, 2009 at 9:48 PM, Christiaan  
> Hofman<[email protected]> wrote:
>> Does anybody know whether it is safe to use the extended attribute  
>> C-library
>> at sys/xattr.h (getxattr, setxattr, etc) on background threads? The
>> documentation does not mention anything about thread safety, but I  
>> could
>> imagine it to run into problems if it'd use global resources, and the
>> functions seem to use at least one global variable.
>
> Those functions will be thread safe. It's a bug if they're not.
>
> Kind regards,
>
> Chris

Thanks Chris. However I am still worried about the fact that they  
access the global variable errno. Even if this is done in a thread  
safe way, how can I know when I inspect it that some other function  
has changed it on another thread?

Christiaan
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.