On 16 November 2010 18:07, <[email protected]> wrote:
> Author: markt
> Date: Tue Nov 16 18:07:56 2010
> New Revision: 1035720
>
> URL: http://svn.apache.org/viewvc?rev=1035720&view=rev
> Log:
> Session manager performance
> Move sync. No performance change but sync requirements for sub-classes are
> clearer.
> Still looking to remove sync completely.
>
> Modified:
> tomcat/trunk/java/org/apache/catalina/session/ManagerBase.java
>
> Modified: tomcat/trunk/java/org/apache/catalina/session/ManagerBase.java
> URL:
> http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/session/ManagerBase.java?rev=1035720&r1=1035719&r2=1035720&view=diff
> ==============================================================================
> --- tomcat/trunk/java/org/apache/catalina/session/ManagerBase.java (original)
> +++ tomcat/trunk/java/org/apache/catalina/session/ManagerBase.java Tue Nov 16
> 18:07:56 2010
> @@ -959,7 +959,7 @@ public abstract class ManagerBase extend
> }
>
>
> - protected void getRandomBytes(byte bytes[]) {
> + protected synchronized void getRandomBytes(byte bytes[]) {
> // Generate a byte array containing a session identifier
> if (devRandomSourceIsValid && randomIS == null) {
> setRandomFile(devRandomSource);
Does the method pre-amble (as above) need to be synch?
AFAICT, most other accesses to devRandomSource and randomIS within the
module are not protected by synch.
> @@ -1008,9 +1008,7 @@ public abstract class ManagerBase extend
> }
>
> while (resultLenBytes < this.sessionIdLength) {
> - synchronized (this) {
> - getRandomBytes(random);
> - }
> + getRandomBytes(random);
> MessageDigest md = digests.poll();
> if (md == null) {
> // If this fails, NPEs will follow. This should never fail
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]