From 493fdcffb7289574fe31356263a8c035b0a966f5 Mon Sep 17 00:00:00 2001 From: khizmax Date: Mon, 19 Jan 2015 21:52:58 +0300 Subject: [PATCH] Bronson's AVL-tree dev --- cds/container/details/bronson_avltree_base.h | 6 +++--- cds/container/impl/bronson_avltree_map_rcu.h | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/cds/container/details/bronson_avltree_base.h b/cds/container/details/bronson_avltree_base.h index a8b78f83..18b2977f 100644 --- a/cds/container/details/bronson_avltree_base.h +++ b/cds/container/details/bronson_avltree_base.h @@ -187,7 +187,7 @@ namespace cds { namespace container { On the other hand, constructing of the new node can be too complex to make it under the lock, that can lead to lock contention. - When this option is enabled, the new node created before locking the parent node. + When this option is enabled, the new node is created before locking the parent node. After that, the parent is locked and checked whether the new node can be attached to the parent. In this case, false node creating can be performed, but locked section can be significantly small. */ @@ -243,7 +243,7 @@ namespace cds { namespace container { typedef opt::v::delete_disposer<> disposer; /// Node lock - typedef cds::SpinLock lock_type; + typedef std::mutex lock_type; /// Enable relaxed insertion. /** @@ -306,7 +306,7 @@ namespace cds { namespace container { the disposer will be called to signal that the memory for the value can be safely freed. Default is \ref cds::intrusive::opt::delete_disposer "cds::container::opt::v::delete_disposer<>" which calls \p delete operator. Due the nature of GC schema the disposer may be called asynchronously. - - \p opt::lock_type - node lock type, default is \p cds::SpinLock + - \p opt::lock_type - node lock type, default is \p std::mutex - \p bronson_avltree::relaxed_insert - enable (\p true) or disable (\p false, the default) @ref bronson_avltree::relaxed_insert "relaxed insertion" - \p opt::item_counter - the type of item counting feature, by default it is disabled (\p atomicity::empty_item_counter) diff --git a/cds/container/impl/bronson_avltree_map_rcu.h b/cds/container/impl/bronson_avltree_map_rcu.h index 9d337527..a7922326 100644 --- a/cds/container/impl/bronson_avltree_map_rcu.h +++ b/cds/container/impl/bronson_avltree_map_rcu.h @@ -14,11 +14,11 @@ namespace cds { namespace container { @headerfile cds/container/bronson_avltree_map_rcu.h This is the specialization of \ref cds_container_BronsonAVLTreeMap_rcu "RCU-based Bronson et al AVL-tree" - for "key -> value pointer" map. This specialization stores the pointer to user-allocated values instead of the copy + for "key -> value pointer" map. This specialization stores the pointer to user-allocated values instead of the copy of the value. When a tree node is removed, the algorithm does not free the value pointer directly, instead, it call the disposer functor provided by \p Traits template parameter. - The set of available member functions is differ from classic map. + The set of available member functions differs from classic map. Template arguments: - \p RCU - one of \ref cds_urcu_gc "RCU type" -- 2.34.1