lkml.org 
[lkml]   [2002]   [Mar]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: Multi-threading
On Wed, 13 Mar 2002 09:23:06 +0100
Andi Kleen <ak@suse.de> wrote:

> On Tue, Mar 12, 2002 at 11:51:29PM -0800, David Schwartz wrote:
> >
> > >Just it might change immediately afterwards if you don't remove the
> > >object from public view first.
> >
> > If it was in public view, whatever held it in public view would be
> > using it, and hence its use count could not drop to zero.
>
> That's not correct at least in the usual linux kernel pattern of using
> reference counts for objects. Hash tables don't hold reference counts,
> only users do. If you think about it a hash table or global list holding
> a reference count doesn't make too much sense.

Depends where you are talking. In the conntrack code (and I thought the
rest of the networking code), 0 means "free me now, NOONE has a pointer",
ie. the hash table holds 1.

dcache holds zero-count entries because their semantic requirements are
different, hence the "atomic_dec_and_lock()" stuff.

Cheers!
Rusty.
--
Anyone who quotes me in their sig is an idiot. -- Rusty Russell.
-
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:25    [W:0.044 / U:0.320 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site