3 ms·
That's pretty much exactly how hash array mapped tries work. Take the first 5 bits of a 32 bit hash, use it to set a flag in the bitfield, a populated field in
by joshuak 9y ago
That's pretty much exactly how hash array mapped tries work.
Take the first 5 bits of a 32 bit hash, use it to set a flag in the bitfield, a populated field indicates a populated child array element, find out which one using popcnt. When you find a conflict on insert take a step down the tree, use the next 5 bits in the 32 bit hash rinse and repeat.
A HAMT is the basis of a fully concurrent data structure for maps which can also do fast atomic snapshots called a ctrie.
- eloff 9y agoI'll add HAMT and tries to my reading list, thanks.