Skip to content

Reduce the memory used by hazard pointers

The hazard pointers implementation was bit of frivolous with memory usage allocating memory based on maximum constants rather than on the usage.

Make the retired list bit use exactly the memory needed for specified number of hazard pointers while avoiding a false sharing at the same time. This reduced the memory used by hazard pointers to one quarter in our specific case because we only use single HP in the queue implementation (as opposed to allocating memory for HP_MAX_HPS = 4).

Cleanup HP_MAX_HPS and HP_THRESHOLD_R constants from the paper, because we don't use them in the code. HP_THRESHOLD_R was 0, so the check whether the retired list size was smaller than the value was basically a dead code.

Edited by Ondřej Surý

Merge request reports