(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 <[EMAIL PROTECTED]>
To: Avalon Developers List <[EMAIL PROTECTED]>
References: 
<[EMAIL PROTECTED]>

Leo Sutic wrote:
 >
 >>From: Vincent Massol [mailto:[EMAIL PROTECTED]]
 >>
 >>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:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to