Re: [Boost-bugs] [Boost C++ Libraries] #12330: boost::thread starts with invalid FPU control word value in Embarcadero C++ Builder

Subject: Re: [Boost-bugs] [Boost C++ Libraries] #12330: boost::thread starts with invalid FPU control word value in Embarcadero C++ Builder
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2017-01-03 08:00:47


#12330: boost::thread starts with invalid FPU control word value in Embarcadero C++
Builder
-------------------------------------------------+-------------------------
  Reporter: Ville-Valtteri Tiittanen <ville- | Owner: viboes
  valtteri.tiittanen@…> | Status: assigned
      Type: Bugs | Component: thread
 Milestone: To Be Determined | Severity: Regression
   Version: Boost 1.55.0 | Keywords:
Resolution: |
-------------------------------------------------+-------------------------

Comment (by Ville-Valtteri Tiittanen):

 Replying to [comment:7 viboes]:
> I have no idea what does it means in terms of the standard interface
 that the parent thread should inherit floating point control word.
>
> Please could you point me where
> "C++ standard specifies that floating point control word should be
 inherited from the parent thread." is specified?

 The C Standard (ISO/IEC 9899:2011) has this statement in 7.6 paragraph 2:

     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.

 The C++ Standard (ISO/IEC 14882:2014) has this statement in 26.3.1
 [cfenv.syn] paragraph 3:

     The floating-point environment has thread storage duration (3.7.2).
 The initial state for a thread’s floatingpoint environment is the state of
 the floating-point environment of the thread that constructs the
 corresponding std::thread object (30.3.1) at the time it constructed the
 object.

 So to match behavior of std::thread as defined by standard, a thread
 object should save the state of floating point environment at the
 beginning of constructor, and restore that environment in the new thread
 after it has been started.

 There is a C++ interface for floating point environment
 (http://en.cppreference.com/w/cpp/numeric/fenv), but I do not know if that
 includes everything that can be changed with _control87().

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/12330#comment:8>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.

This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:20 UTC