You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@commons.apache.org by "Baker, Anthony" <ab...@c-cor.com> on 2005/04/07 08:10:04 UTC

[math] thread-safety of DescriptiveStatistics?

Is DescriptiveStatistics safe to use in a multi-threaded environment?  I have a statistics producer that is accessed by multiple threads and thus simultaneous invocations of addValue() are likely.  Is this ok?  What about changes to the window size?

Any insight you can shed on the intended usage pattern is greatly appreciated.

Thanks,
Anthony

Re: [math] thread-safety of DescriptiveStatistics?

Posted by Mark Diggory <md...@gmail.com>.
No, I wouldn't expect it to be thread safe at this time. This design 
decision was made for performance reasons. Your best bet would be to 
wrap it in a thread safe wrapper to block your calls to externally:

http://www.javaworld.com/jw-08-1998/jw-08-techniques-p5.html

-cheers,
Mark Diggory

Baker, Anthony wrote:

>Is DescriptiveStatistics safe to use in a multi-threaded environment?  I have a statistics producer that is accessed by multiple threads and thus simultaneous invocations of addValue() are likely.  Is this ok?  What about changes to the window size?
>
>Any insight you can shed on the intended usage pattern is greatly appreciated.
>
>Thanks,
>Anthony
>
>  
>


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org