Previous | Next --- Slide 29 of 35
Back to Lecture Thumbnails

I found this article about lock-free data structures with hazard pointers which provides a detailed explanation on how hazard pointers can be used on maps. The note to understanding hazard pointers is that the hazard pointer for a thread is used to be read by multiple threads but written by one thread (which is showed from the program in this slide).


Here the original paper, which is written quite clearly.


@kayvonf, how does one thread poke into another's address space and look at the hazard variable, as show in the pseudo code "n not pointed to by any thread's hazard points"?


@xingdaz Answer's in the original paper


I've often heard people say that garbage collectors make lock-free programming easier because of problems like this, but that simply punts the problem to the garbage collector, which is almost certainly not lock-free.

Are there any performance analyses of lock-free data structures that rely on a garbage collector vs not? It seems like there might be a benefit just from the better cache behavior that garbage collectors can sometimes grant.