Re: fenv support vs. SMP systems

Joel Sherrill <[email protected]>
Newsgroups gmane.comp.lib.newlib
Message-ID <CAF9ehCU2TDFjDp8LRXsajvNifpFJhT5PEWKTuvE8+qh7dH4Wsg@mail.gmail.com>
On Mon, Jul 13, 2020, 12:17 PM Joseph Myers <[email protected]> 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
> [email protected]
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.