Why is the following snippet for deleting a node in a linked list not thread safe?
edit: note every node has a lock of its own
// ... lock acquisitio
You might wanna take a look at this presentation. From slide #39, it demonstrates how fine-grained linked list locking should be implemented, in a clear and figurative way (the slides' notes add some explanations as well). The presentation is based on (or taken from...) a book called The Art of Multiprocessor Programming.