Re: [Lse-tech] Re: RFC: patch to allow lock-free traversal of lists with insertion

From: Dipankar Sarma (
Date: Wed Oct 10 2001 - 01:54:00 EST

In article <> Linus Torvalds wrote:

> Now, in all fairness I can imagine hacky lock-less removals too. To get
> them to work, you have to (a) change the "next" pointer to point to the
> next->next (and have some serialization between removals, but removals
> only, to make sure you don't have next->next also going away from you) and
> (b) leave the old "next" pointer (and thus the data structure) around
> until you can _prove_ that nobody is looking anything up any more, and
> that the now-defunct data structure can truly be removed.

This is exactly what Read-Copy Update does. You keep the old data
structure around until you are sure that all the CPUs have lost
references to it by context switching. There are more than
one relatively non-intrusive ways of detecting completion of such a cycle
and "deleted" data can be freed afterwards.

The details are in


Dipankar Sarma  <> Project:
Linux Technology Center, IBM Software Lab, Bangalore, India.
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

This archive was generated by hypermail 2b29 : Mon Oct 15 2001 - 21:00:30 EST