lkml.org 
[lkml]   [2001]   [Oct]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [Lse-tech] Re: RFC: patch to allow lock-free traversal of lists with insertion
On Wed, 10 Oct 2001 03:18:23 -0700 (PDT)
Linus Torvalds <torvalds@transmeta.com> wrote:

> lock
> unhash
> unlock
> if (atomic_dec()) {
> free
> }

And the read side is:
lock
loopup
atomic_inc
unlock

With RCU, read side is:
loopup
atomic_inc

Write is:
lock /* protect against other writes */
unhash /* be careful with wmb()s here... */
unlock
call_rcu(if (atomic_dec()) free) /* ie. does this later */

Clear?
Rusty.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:08    [W:0.143 / U:3.592 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site