Bug 52183 - SyncTimer could be improved (performance+reliability)
SyncTimer could be improved (performance+reliability)
Status: RESOLVED FIXED
Product: JMeter
Classification: Unclassified
Component: Main
Nightly (Please specify date)
All All
: P2 enhancement (vote)
: ---
Assigned To: JMeter issues mailing list
:
Depends on:
Blocks:
  Show dependency tree
 
Reported: 2011-11-14 22:08 UTC by Philippe Mouawad
Modified: 2011-11-23 22:34 UTC (History)
1 user (show)



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Philippe Mouawad 2011-11-14 22:08:11 UTC
NIghtly 1

SyncTimer calls sync.wait outside of a loop which according to :
http://download.oracle.com/javase/6/docs/api/java/lang/Object.html#notifyAll%28%29

is wrong.

Furthermore, java.util.concurrent.CyclicBarrier would be a better solution to the current implementation and would greatly simplify it.

The only remaining pb to this is when GroupSize is set to 0.
As cyclicBarrier must be created in test plan start, JMeterContextService.getContext().getThreadGroup().getNumThreads() is not available at this time.

Sebb, do you know how to get this information at test plan start ?

Thanks
Comment 1 Sebb 2011-11-15 17:29:28 UTC
The testStarted() methods are called before any thread groups are created.
There may be multiple groups with different counts so it's not possible to provide the thread group count.

The ThreadListener interface is called after the thread group has been created, so it might be possible to create the barrier there.

The ThreadListener method will need to enure that the barrier is only created once for each Thread Group.
Comment 2 Philippe Mouawad 2011-11-23 22:34:17 UTC
Date: Wed Nov 23 22:33:32 2011
New Revision: 1205639

URL: http://svn.apache.org/viewvc?rev=1205639&view=rev
Log:
Bug 52183 - SyncTimer could be improved (performance+reliability)

Added:
   jmeter/trunk/src/components/org/apache/jmeter/timers/BarrierWrapper.java   (with props)
   jmeter/trunk/src/components/org/apache/jmeter/timers/SyncTimer.java
Modified:
   jmeter/trunk/xdocs/changes.xml