ConcurrentHashMap can do concurrent put() operations and concurrent get() operations... and that's the tricky part.
I just love all that stuff that Doug Lea has done. For those who haven't looked at util.concurrent, I recommend it. Sounds like others do as well.
phil.
Kevin A. Burton wrote:
Torsten Curdt wrote:
Guys, forgive me if this too off topic...
...but I thought it is somehow related to collections that's why I am bringing it up here anyway. I bet someone of you will know....
Ignore what everyone else says on this list topic. ha.
Use a ReentrantReadWriteLock from JDK 1.5. There's a backport to JDK 1.4 out on the net. Google for "backport concurrent oswego" or something
Then you can do a
lock.readLock().lock()
on our gets and then do a writeLock on your puts. the writeLock will backup the readlock but if you only have readlocks they can all happen at once.
Normally though its not too big a deal since gets() on a hashtable are O(1)....
Kevin
-- Whirlycott Philip Jacob [EMAIL PROTECTED] http://www.whirlycott.com/phil/
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
