atomic_t vs. volatile?

From: Jeff Garzik (jgarzik@mandrakesoft.com)
Date: Sun May 14 2000 - 12:56:23 EST


Some of the net drivers maintain "current tx" (cur_tx) and "dirty tx"
(dirty_tx) pointers, which point to packet buffers being produced in
xxx_start_xmit, and consumed via the interrupt handler.

It seems like spinlocking can be avoided completely by using some sort
of atomic variables, instead of locking the private structure, updating
these pointers, and then unlocking the private structure.

Is marking these two variables "volatile" sufficient for atomicity? Or
is atomic_t needed?

        Jeff

-- 
Jeff Garzik              | Liberty is always dangerous, but
Building 1024            | it is the safest thing we have.
MandrakeSoft, Inc.       |      -- Harry Emerson Fosdick

- 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/



This archive was generated by hypermail 2b29 : Mon May 15 2000 - 21:00:24 EST