[concurrency-interest] Timestamps-based ConcurrentMap

Tim Peierls tim at peierls.net
Sun Mar 12 09:30:22 EST 2006

On 3/10/06, Jean Morissette <jean.morissette at gmail.com> wrote:

> > However, they need to reflect the
> > state of the map at the creation of the iterator, independently of the
> > map update operations.

Maybe what you're looking for is an implementation of ConcurrentMap based on
purely functional data
The current state of the map could be maintained as an AtomicReference to
such a data structure. Mutative operations could optimistically create a new
state and CAS the AtomicReference with it. Non-mutative operations,
including iterator creation, would hold a reference to a consistent but
possibly out-of-date immutable data structure. This approach is only a win
if you expect low contention by mutative operations, i.e., if the CAS
operations will usually succeed.

But this doesn't use CHM at all.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: /pipermail/attachments/20060312/01fa55f4/attachment.html

More information about the Concurrency-interest mailing list