Re: Locking of nodes in tree for concurrent access
- From: oliver789@xxxxxx
- Date: Mon, 3 Nov 2008 05:53:52 -0800 (PST)
Hi Lew,
thanks for the answer. At least someone was able to understand what I
was trying to explain about what I was thinking of .. ;-). I should
have mentioned that I don't store the data in the leaf nodes as this
is usually the case but in the respective node somewhere within the
tree. Some item is categorized by N criterias (a criteria is the value
of a basic data type such as String, int, etc. including null). N is
typically rearely larger than, say, 5. Iterating over the list of
criterias for every next criteria a new sub node is created.
You also have to be very, very careful about deadlock.
... but it looks from your description as though you
might acquire locks in different orders, a recipe for disaster.
All right. I see the point. I will have a look into the book you
mentioned. Maybe I get some hint the :-)
Thanks, Oliver
On 3 Nov., 14:10, Lew <no...@xxxxxxxxxxxxx> wrote:
oliver...@xxxxxx wrote:
So far I see no logical error in that approach. My concern is that
this approach might not be very efficient under heavy load (large
number of concurrent accesses of the tree), because for every visited
node in the tree the node's lock has to be opened and closed. That is
For a good understanding of Java concurrency in practice, an excellent
resource is /Java Concurrency in Practice/ by Brian Goetz, et al.
Java 6 has much more efficient handling of locks than earlier versions.
Still, your approach does seem very inefficient at first blush.
You also have to be very, very careful about deadlock. Without seeing an
SSCCE it's hard to be sure, but it looks from your description as though you
might acquire locks in different orders, a recipe for disaster.
--
Lew
.
- References:
- Locking of nodes in tree for concurrent access
- From: oliver789
- Re: Locking of nodes in tree for concurrent access
- From: Lew
- Locking of nodes in tree for concurrent access
- Prev by Date: how to pass argument values to ant
- Next by Date: Free!
- Previous by thread: Re: Locking of nodes in tree for concurrent access
- Next by thread: Re: Locking of nodes in tree for concurrent access
- Index(es):
Relevant Pages
|