This is the mail archive of the libc-help@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Thread safe functions from the C standard library


On Tue, Dec 9, 2008 at 10:50 AM, David Livshin
<david.livshin@dalsoft.com> wrote:
> Hi,
>
> What functions from the GNU's C standard libraries ( libc, libm ) are thread
> safe? Of a particular interest are transcendental functions ( like 'exp',
> 'sin' etc. ) - are they thread safe?
>
> Are there any requirements/guidelines/assurances regarding thread safety of
> functions from a C library?

GLIBC strives to be ISO C and POSIX compliant. POSIX gives assurances
with regards to thread-safety and reentrancy (two distinct issues).

For example ISO C and POSIX define "exp" e.g.
http://www.opengroup.org/onlinepubs/009695399/functions/exp.html

The POSIX thread-safey section:
http://www.opengroup.org/onlinepubs/009695399/functions/xsh_chap02_09.html#tag_02_09_01
does not list exp in the thread-unsafe functions, therefore it should
be thread-safe.

Cheers,
Carlos.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]