[SVN r70068]
This commit is contained in:
Ion Gaztañaga
2011-03-17 16:41:49 +00:00
parent b9dce1daae
commit 75df697ca8
3 changed files with 36 additions and 10 deletions

View File

@@ -3831,6 +3831,20 @@ all the objects to be inserted in intrusive containers in containers like `std::
[section:release_notes Release Notes]
[section:release_notes_boost_1_47_00 Boost 1.47 Release]
* Fixed bug
[@https://svn.boost.org/trac/boost/ticket/5183 #5183],
[endsect]
[section:release_notes_boost_1_46_00 Boost 1.46 Release]
* Fixed bug
[@https://svn.boost.org/trac/boost/ticket/4980 #4980],
[endsect]
[section:release_notes_boost_1_45_00 Boost 1.45 Release]
* Added `function_hook` option.

View File

@@ -291,18 +291,18 @@
<File
RelativePath="..\..\..\..\..\boost\intrusive\detail\workaround.hpp">
</File>
<Filter
Name="doc"
Filter="">
<File
RelativePath="..\..\..\doc\intrusive.qbk">
</File>
<File
RelativePath="..\..\..\doc\Jamfile.v2">
</File>
</Filter>
</Filter>
</Filter>
<Filter
Name="doc"
Filter="">
<File
RelativePath="..\..\..\doc\intrusive.qbk">
</File>
<File
RelativePath="..\..\..\doc\Jamfile.v2">
</File>
</Filter>
<Filter
Name="Test headers"
Filter="">

View File

@@ -15,3 +15,15 @@
-> Document incremental<> option better
-> Assure stable order for optimize_multikey and inverse order otherwise
-> add an option to unordered containers to get O(1) traversal and begin()/end() even with very low load factors
The article explains it quite well: Linear Hashing The cost of hash table expansion is spread out across each hash table insertion operation, as opposed to being incurred all at once. Linear hashing is therefore well suited for interactive applications.
Linear hashing typically requires power of two length for bucket arrays, but those buckets are not fully used from the beginning, as it is when using non-linear hashing (which typically requires prime bucket length). Although the bucket array hash, say, has 16 buckets, the implementation uses first just one or two, then when after incremental rehashing uses three, etc.. incrementally, until it fills those 16 buckets. Then for a new incremental rehash, it allocates a new bucket array with length 32, but starts using only 17, and continues with incremental hashing. I think Dinkum STL used this incremental rehashing. The key is that in each incremental hashing, not all elements are rehashed, but just elements of a single bucket, distributing hashing impact in all allocations.
For more information on hashing alternatives see the original standard hashing container proposal (chapter Control of Hash Resizing):
http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2003/n1456.html
Now, intrusive containers don't allocate memory at all, so incremental rehashing must be trigered by the user using
"incremental_rehash(bool)" (use an additional bucket, that is, incremental rehash) and "incremental_rehash(bucket_traits)" (to update the new bucket array with an array that should be twice/half the size of the previous one). I admit that this is not explained at all with an example, so I will note this issue in my to do list.