Hi Zoly, thanks a lot for your contribution, it would be better if you can fill an issue providing a patch, I'll take care of it as soon as possible. Thanks in advance, Simo
http://people.apache.org/~simonetripodi/ http://www.99soft.org/ On Thu, Jan 20, 2011 at 3:13 AM, zoly farkas <zolyfar...@yahoo.com> wrote: > the use volatiles : waiting,complete,totalBorrowTime, totalReturnTime, > nrSamples > is not correct. > > > for ex the following totalBorrowTime += borrowTime is not atomic resulting in > a > race condition. > > one way to fix this is using the java.util.concurent Atomic variants or even > better, > make these variables members of MyThread and aggregate them at the end of the > test, > this way there will be no need to use Atomic and thus increasing efficiency, > and > accuracy of the test of the test. > > also: > > private boolean start; > > needs to be volatile, due to visibility issue. > (when updating start other threads might not pick up the value) > > > cheers > > --Zoltan > > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org > For additional commands, e-mail: dev-h...@commons.apache.org > > --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org For additional commands, e-mail: dev-h...@commons.apache.org