Re: spin_lock() versus atomic_*

Chris Wedgwood (chris@cybernet.co.nz)
Thu, 8 Oct 1998 19:12:20 +1300


On Wed, Oct 07, 1998 at 08:24:11PM -0400, Paul Barton-Davis wrote:

> Is there a reason to choose one of:
>
> spin_lock (&some_lock);
> some_counter++;
> spin_unlock (&some_lock);
>
> or
>
> atomic_inc (&some_atomic_counter);
>
> Its not clear to me which is better right now.

That latter is smaller and faster... much.

-cw

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