I am using JMeter 1.9.1.
"pairing" is a static varible which can be accessed concurrently by multiple threads.
On my system, ( 8 way Solaris Sparc E4500), intermittenly some Entry in HashSet
loops back into itself so the program is stuck in the while loop in 
java.util.HashMap.containsKey.
( the code of the while loop is 
...
Entry e = table [i];
while ( e ! = null ) {
   if ( e.hash == hash && eq(k, e.key) )
    return true;
   e = e.next;
}
return false;
)
 
SynchronizedSet synchronizes access to the static "pairing" HashSet so the state of it 
won't be corrupted.
 
Thanks,
June

[EMAIL PROTECTED] wrote:
I found a similar problem testing on a system with multiple CPUs a few months ago, and 
checked in a fix in version 1.36 of the
source file (2003-10-22)

As far as I can see, all accesses to the pairing HashSet are now synchronized, so I 
don't understand how changing to a
synchronizedSet would help - but perhaps I'm missing something.

Which version of JMeter (and TestCompiler.java) are you using?

S.
----- Original Message ----- 
From: "Jun Zhong" 
To: 
Sent: Monday, April 05, 2004 12:29 AM
Subject: Should the HashSet used in org/apache/jmeter/threads/TestCompiler.java be 
synchronized ?


Should the variable "pairing" in org/apache/jmeter/threads/TestCompiler.java be 
synchronized ?

I am evaluating JMeter as a stress tool to test Tomcat. I configurated 200 threads,
each thread repeated 30 times. The test plan was run in an endless while loop.
After a while (usually within half an hour), the test hangs.

Furthur investigation revealed that the state of the variable "pairing" was corrupted 
by
concurrent access and modification by multiple threads.

I modified the line
private static pairing = new HashSet();
to
private static pairing = Collections.synchronizedSet(new HashSet());

The problem disappeared with the change. The test lasted for more than 24 hours before
I interruped it.

Thanks,
June Zhong



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to