[infinispan-dev] What's behind the data containers: implementing a performant, thread-safe ordered data container

Manik Surtani manik at jboss.org
Wed May 13 05:29:20 EDT 2009


On 13 May 2009, at 09:28, Christian Vest Hansen wrote:

> Interesting read. It's a concurrent hash-map of sorts, but one that
> can be efficiently traversed by insertion order?

Yes, although I don't support all of ConcurrentMap's functionality  
(don't need it in DataContainer).

> One thing that was a bit confusing, is when you seemingly mention
> segment locking in the context of a lock-free data structure. Perhaps
> reads are lock-free but writes are protected by a striped locking
> scheme?

I don't mention that the data container is lock-free.  I do specify  
that the linked list is lock-free though.  The segment lock when there  
is a put() does not protect links.  It only protects the LinkedEntry  
in question.  But if the previous and next entries happen to reside in  
different segments, they could be concurrently updated (inserted/ 
removed) and that would affect linking.  And hence the need for a  
linked list algorithm that is thread safe and lock-free.  Lock-free,  
not just for performance but also to prevent deadlocks with the  
segment locks.

> Anyways, it's nice to witness this attension to concurrent performance
> and to read about an interesting datastructure :)

Thanks!

>
>
> On Tue, May 12, 2009 at 5:15 PM, Manik Surtani <manik at jboss.org>  
> wrote:
>> Discussing the internals behind data containers in Infinispan.
>>
>>
>>  http://infinispan.blogspot.com/2009/05/implementing-performant-thread-safe.html
>>
>> Enjoy!
>>
>> --
>> Manik Surtani
>> manik at jboss.org
>> Lead, Infinispan
>> Lead, JBoss Cache
>> http://www.infinispan.org
>> http://www.jbosscache.org
>>
>>
>>
>>
>> _______________________________________________
>> infinispan-dev mailing list
>> infinispan-dev at lists.jboss.org
>> https://lists.jboss.org/mailman/listinfo/infinispan-dev
>>
>
>
>
> -- 
> Venlig hilsen / Kind regards,
> Christian Vest Hansen.

--
Manik Surtani
manik at jboss.org
Lead, Infinispan
Lead, JBoss Cache
http://www.infinispan.org
http://www.jbosscache.org







More information about the infinispan-dev mailing list