This is not a correctness issue (except that currently it loses a reference, leaking node 5); the invariants for the level-0 list are preserved. It is confusing, tho.
Ideally we would form towers bottom-up, preventing the observation of the lower levels of partially-completed towers. Unfortunately there is no way to do this with a finite set of hazard pointers, except with n*log(n) cost of repeated calls to find.
// XXX double check that it's ok to fail
: it is not ok to fail.Marking the towers top-down can cause partitioning at a list level, reducing the effectiveness of the index lists:
T1, start linking node 1 w/ an incomplete tower:
T2, fully link node 5, picking up the incomplete references from node 1
T3 finishing linking node1, cutting off the middle level of node 5.
This is not a correctness issue (except that currently it loses a reference, leaking node 5); the invariants for the level-0 list are preserved. It is confusing, tho.
Ideally we would form towers bottom-up, preventing the observation of the lower levels of partially-completed towers. Unfortunately there is no way to do this with a finite set of hazard pointers, except with
n*log(n)
cost of repeated calls tofind
.