avalon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Berin Loritsch <blorit...@apache.org>
Subject [Fwd: Re: Performance questions about ECM]
Date Fri, 08 Mar 2002 16:49:54 GMT
(My SMTP server is cracking up)



-------- Original Message --------
Subject: Re: Performance questions about ECM
Date: Fri, 08 Mar 2002 10:10:28 -0500
From: Berin Loritsch <bloritsch@apache.org>
To: Avalon Developers List <avalon-dev@jakarta.apache.org>
References: 
<MCEHJNGEDNCOGPCCMCEKGEFACNAA.leo.sutic@inspireinfrastructure.com>

Leo Sutic wrote:
 >
 >>From: Vincent Massol [mailto:vmassol@octo.com]
 >>
 >>Leo,
 >>
 >>I was wondering really about why we have to use synchronized in
 >>BucketMap.get().
 >>
 >
 > I think the only risk is a concurrent BucketMap.put that may resize the
 > map and thus move stuff around. Then again, I might be wrong about 
this one.

BucketMap is never resized.  Keep in mind that BucketMap only
synchronizes when absolutely necessary. It depends on the hash of the
object being stored.  Assuming we have two objects, one with a hash of
233 and another with a hash of 2.  They will never contend for each
other.

The only time you have thread contention is when the objects are in the
same "bucket"--i.e. have the same hash value.



-- 

"They that give up essential liberty to obtain a little temporary safety
   deserve neither liberty nor safety."
                  - Benjamin Franklin


-- 

"They that give up essential liberty to obtain a little temporary safety
  deserve neither liberty nor safety."
                 - Benjamin Franklin


--
To unsubscribe, e-mail:   <mailto:avalon-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:avalon-dev-help@jakarta.apache.org>


Mime
View raw message