Re: Unreliable Guide to Locking - Addition?

From: Rusty Russell
Date: Mon Aug 08 2005 - 21:40:47 EST


On Mon, 2005-08-08 at 18:41 +0530, Kedar Sovani wrote:
> when the last atomic_dec_and_test() (the last == the one which
> returns 0) is being called on the object, the object is usually not
> accessible to others (list_del()) and hence the simultaneous
> atomic_inc() call never occurs.

Yes, a reference count must count references. Of course, you can get
around with with "atomic_dec_and_lock", but I hate that primitive as it
has scalability issues (it can't be translated to RCU).

I'll look and see if I can make this requirement explicit.

Thanks!
Rusty.
--
A bad analogy is like a leaky screwdriver -- Richard Braakman

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