commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Berin Loritsch" <blorit...@apache.org>
Subject RE: [Collections] StaticBucketMap not thread safe
Date Tue, 25 Jun 2002 21:08:51 GMT
> From: Jack, Paul [mailto:pjack@sfaf.org] 
> 
> However, I was wrong.  *Every* access to m_buckets is 
> synchronized, it's just synchronized on some other object's 
> monitor.  But that doesn't matter, as threads still have to 
> go through a memory barrier in order to fetch a Node.
> 
> So, false alarm.  That's the second time I posted something 
> today and immediately realized I shouldn't have.  I just got 
> back from a four-day vacation, my mind is clearly still at 
> the beach. :)
> 
> There still might be threading issues with making the 
> collection views properly follow the Map contract, but then 
> again, maybe not.  I'll see what I can do...

Here is a new version (CVS diff in Excalibur CVS) that removes
the need for the array of locks.  It locks on the nodes themselves.

See how this does (it is probably quicker too because there is
only one array lookup....)

Mime
View raw message