0

I have utilized org.apache.commons.math3.analysis.interpolation.LinearInterpolator and org.apache.commons.math3.analysis.interpolation.SplineInterpolator in the following way: I initialized SPLINE_INTERPOLATOR as static final

private static final SplineInterpolator SPLINE_INTERPOLATOR = new SplineInterpolator();

and let multiple processes use it to interpolate some data x and y (SPLINE_INTERPOLATOR.interpolate(x, y)). Yesterday, a colleague asked me whether this usage of SplineInterpolator is legit, i.e. whether it is thread-safe. I googled for answers, but couldn't find anything. Does anyone know whether SplineInterpolator is thread-safe?

Thanks a bunch in advance.

dotwin
  • 1,302
  • 2
  • 11
  • 31
  • 1
    General rule is to assume it is *not* thread-safe unless the documentation explicitly states that it is. Alternatively, you can check the source code itself for unsafe constructs. – President James K. Polk Oct 22 '16 at 22:47
  • 1
    SplineInterpolator appears to be threadsafe. – MeBigFatGuy Oct 23 '16 at 00:00
  • This is great to hear, thank you MeBigFatGuy. And I do agree with you, James K Polk, that I should opt to be safe and assume it to not be in case I am unsure... – dotwin Oct 23 '16 at 00:48

0 Answers0