1 Nov 2008 01:41
Re: Re: Why 'round' does not just round numbers ?
Sterling Clover <s.clover <at> gmail.com>
2008-11-01 00:41:50 GMT
2008-11-01 00:41:50 GMT
On Oct 30, 2008, at 5:21 PM, Bertram Felgenhauer wrote: > George Pollard wrote: >> There's also the ieee-utils package, which provides an IEEE monad >> with >> `setRound`: >> >> http://hackage.haskell.org/packages/archive/ieee-utils/0.4.0/doc/ >> html/Numeric-IEEE-RoundMode.html > > When run with +RTS -N2 -RTS, the output randomly alternates > between Downward and ToNearest - for me at least. > > The problem is that the setRound call will only affect one worker > thread, while the RTS will sometimes migrate RTS threads from one > worker to another. > > runIEEE really has to be executed in a bound thread (see forkOS > documentation). Using `par` will also cause trouble - in fact even > more. > That's a really nice catch! Dons has pointed out to me both the very handy forkOnIO which ensures the forked thread remains bound to a single CPU, and also the -qm flag to the RTS, which prevents thread migration between capabilities. Running the example program with +RTS -N2 -qm restores(Continue reading)
RSS Feed