|
|
|
|
|
by brucehoult
1968 days ago
|
|
At a minimum, when there is a switch between threads the floating point state of the old thread needs to be saved and the floating point state of the incoming thread loaded. This includes such things as rounding mode. If the thread package was not setting up the "saved" state for a new thread before switching to it then that state could be not what was desired. The best thing to do would probably be to copy the current FP state of the parent at the moment the thread is created. On a long series of calculations changing the rounding mode could well be enough to cause the difference in results the poster saw. I would tend to the opinion that redoing the calculation with different rounding modes is in fact a not bad way to figure out how reliable the results are in the first place. (the rounding mode is not the only thing affected by not saving and restoring the FP state correctly) |
|