fenv support vs. SMP systems

Joel Sherrill joel@rtems.org
Mon Jul 13 21:03:06 GMT 2020


On Mon, Jul 13, 2020, 12:17 PM Joseph Myers <joseph@codesourcery.com> wrote:

> On Mon, 13 Jul 2020, Joel Sherrill wrote:
>
> > It does use the term "system variable" but that doesn't scope it to
> > process or thread.
>
> C11 (the first version of ISO C to introduce threads) says "The
> floating-point environment has thread storage duration. The initial state
> for a thread’s floating-point environment is the current state of the
> floating-point environment of the thread that creates it at the time of
> creation.".
>

Thanks Jim. This really clarifies things. It is unfortunate that POSIX has
threads but ignores them in defining behaviour in places.

Sounds like ensuring the floating point context includes whatever is
required for the floating point environment to persevere across thread
context switches and migrations in an SMP system.

Is this worth a note in the documentation?

--joel

>
> --
> Joseph S. Myers
> joseph@codesourcery.com


More information about the Newlib mailing list