Orekit working with parallelStream causes strange problems.
I use parallelStream and its forEach() method to increase the simulation speed, by doing it parallelly. However, I found the results are very different from what I got when doing it serially. So I digged and did some test.
The simplest experiments I get finally is attached with this issue. When I run it after 4 or 5 times or more, the parallel results starts to be inaccurate. To my understanding, the results should not be effected as long as all threads are safe and separated.
The thing I cannot figure out is that whether the Orekit support this parallelStream or not?
P.S. Since I'm new to Java, maybe I had made some mistakes, so, please test the attachments and hope you can reproduce the mistakes. Thanks a lot.
(from redmine: issue id 258, created on 2016-10-20, closed on 2017-07-27)
- Uploads:
- Test_04_ParallelStream.java Run this 4~5 times and it starts to give different results.
- Common.java some common static methods
- SetUpOrekitDataFile.java You need to set up by yourself.
- issue-258-failing-test-case.patch test case reproducing the error in the current master branch