Hi,
I added an implementation of a List to the toolkit that works in express. This
is basically an ArrayList, meaning that it's internally unlocked, but properly
clustered when used within the context of a lock. While this corresponds to how
we've been clustering regular collections in DSO before, I'm not certain I feel
that this fits well within the toolkit. Any other implementation in there
doesn't need additional locking. So, to use the list directly now, I have to do
something like this:
List<String> list = toolkit.getList("bob");
ReadWriteLock lock = toolkit.getReadWriteLock("bree");
lock.writeLock().lock();
try {
list.add("bob");
list.add("martin");
} finally {
lock.writeLock().unlock();
}
What do you think about internalizing the locking into this list implementation
and ensuring that it's always thread-safe?
Thanks,
Geert
--
Geert Bevin
Terracotta - http://www.terracotta.org
_______________________________________________
tc-dev mailing list
[email protected]
http://lists.terracotta.org/mailman/listinfo/tc-dev