Manage Granularity in Deuce

10 views
Skip to first unread message

Carmelo Polito

unread,
May 3, 2011, 9:49:56 AM5/3/11
to Deuce-STM developers, mbruno....@tiscali.it
Hi,
I would to get some information about how to manage granularity in
Deuce.
For example: I've a vector of objects and a lot of "users" that want
to obtain these objects in transactional mode. Naturally, the vector
is also an object.
Because of this, if I try to access to a single object in the vector,
all the other transactions (that want to acquire any other object
inside the same vector) will fail. This is for me an huge problem.

So, my problem is: can i obtain a single object, without blocking the
entire vector?
Or what kind of data-structure can i use to solve this problem?

Apologize for my poor english.

Regards.

Carmelo Polito.


Guy Korland

unread,
May 5, 2011, 4:31:00 PM5/5/11
to Deuce-STM developers
What do you mean by obtain a single object?
If you mean remove from the Vector, than the case is a bit different
than what you describe.
Meaning, if two threads obtain different objects than unless they try
to retrieve the same object than the two transaction won't conflict.
On the other hand you should notice two issues:
1. Using any java.util.* collection maintains a global counter to
answer getSize().
This counter can become easily a bottleneck.
2. Using java.util.Vector can't scale since it is a synchronized class
which can't benefit from STM.

Guy

mfazio

unread,
May 12, 2011, 7:13:01 AM5/12/11
to Deuce-STM developers
Hi, I have a similar problem: I have to manage many objects in a
collection and several threads that retrieve these objects.
If two threads retrieve different objects, transaction won't conflict.
Otherwise, if they works on the same object, transaction will
conflict. So, which is the useful java.util.* collection which
benefits from STM? Or do you suggest to use a different approach?
Also, I need to evaluate different policies of the Contention Manager.
I have seen many CMs implemented in deuce at
http://deuce.googlecode.com/svn/trunk/Deuce/src/java/org/deuce/transaction/tl2cm/cm/
How may I configure the CM I prefer?

Thanks for help,

Maria
Reply all
Reply to author
Forward
0 new messages