This is the mail archive of the
libc-help@sourceware.org
mailing list for the glibc project.
Re: Thread safety of functions generated when using -ffinite-math-only gcc command option
- From: "Carlos O'Donell" <carlos at systemhalted dot org>
- To: David Livshin <david dot livshin at dalsoft dot com>
- Cc: "libc-help at sourceware dot org" <libc-help at sourceware dot org>
- Date: Tue, 29 Jul 2014 09:49:35 -0400
- Subject: Re: Thread safety of functions generated when using -ffinite-math-only gcc command option
- Authentication-results: sourceware.org; auth=none
- References: <53D725A4 dot 7030305 at dalsoft dot com>
On Tue, Jul 29, 2014 at 12:40 AM, David Livshin
<david.livshin@dalsoft.com> wrote:
> gcc ( when called with -ffinite-math-only option ) generates calls to
> "__<name>_finite" functions ( e.g. __exp_finite ) - which of these functions
> are thread safe?
> May it be assumed that "__<name>_finite" function is thread safe iff
> "<name>" is thread safe?
Yes.
The compiler switch should not change the underlying semantics of the
operation unless it says it does.
In general the math routines tend to be pure and thus thread safe.
There are some exceptions particularly when dealing with software
emulated floating point, but I believe we've fixed those
implementations to use thread local storage.
Cheers,
Carlos.