You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by bu...@apache.org on 2012/03/20 15:57:07 UTC

DO NOT REPLY [Bug 43790] concurrent access issue on TagHandlerPool

https://issues.apache.org/bugzilla/show_bug.cgi?id=43790

--- Comment #8 from Ian Hartney <ia...@gmail.com> 2012-03-20 14:57:07 UTC ---
There does appear to be a concurrency issue with the synchronized block
approach when using Java 5.  However in Java 6 the synchronized block approach
appears faster than the LinkedBlockingQueue approach.

I have a little test harness that used 250 threads to concurrently access a
queue in the same manner as the TagPoolHandler.  Each loop does a get of an
object, then a reuse call on the object 10000 times.  It runs the same test
using the synchronized block approach, then another using the
LinkedBlockingQueue (LBQ) approach.

On Java 5 the test takes around 11000 ms to complete for the synchronized block
approach, the LBQ approach takes 700 ms.  Conversely on Java 6 the synchronized
block approach is much improved, taking around 450 ms whereas the LBQ approach
takes 750 ms.

So when using Java 5 it does appear that the LBQ approach has some significant
performance advantages to the synchronized block approach.

The tested versions of java were 1.5.0_22 and 1.6.0_23

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org