Hi!

On Oct 9, 2007, at 12:10 AM, dormando wrote:

Are increments atomic across SMP/multicore? It'd be hard to corrupt it, but I don't know off the top of my head if it's safe to ignore locking when you're just reading/writing to one set of 4-8bytes. I'll have to

Not even close to being atomic. Not only do you have issues with multicore, you have worse issues with SMP because of the costs around synchronizing the variables across the CPU transport (aka the bus between the CPU's).

When incrementing/changing values you need to wrap the write in a mutex if you want to be sure of the change.

Cheers,
        -Brian

--
_______________________________________________________
Brian "Krow" Aker, brian at tangent.org
Seattle, Washington
http://krow.net/                     <-- Me
http://tangent.org/                <-- Software
http://exploitseattle.com/    <-- Fun
_______________________________________________________
You can't grep a dead tree.


Reply via email to