#4391: forkIO threads do not properly save/restore the floating point 
environment
---------------------------------+------------------------------------------
    Reporter:  draconx           |        Owner:              
        Type:  bug               |       Status:  new         
    Priority:  normal            |    Milestone:  7.2.1       
   Component:  Runtime System    |      Version:  6.12.3      
    Keywords:                    |     Testcase:              
   Blockedby:                    |   Difficulty:              
          Os:  Unknown/Multiple  |     Blocking:              
Architecture:  x86_64 (amd64)    |      Failure:  None/Unknown
---------------------------------+------------------------------------------

Comment(by simonmar):

 Ok, so the simple fact is that if you use functions from `fenv.h` then
 floating-point operations are rendered impure, and all bets are off.

 We can document exactly what GHC does, so those who really know what
 they're doing might be able to use `fenv.h` functions reliably.

 Regarding the FFI point: GHC does not preempt a foreign call, so it's safe
 to temporarily change the rounding mode during a foreign call, as long as
 it is changed back before returing.  Both safe and unsafe foreign calls
 are fine in this respect.

-- 
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/4391#comment:10>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
_______________________________________________
Glasgow-haskell-bugs mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs

Reply via email to