brian at tangent.org
Fri Oct 12 00:45:08 UTC 2007
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.
Brian "Krow" Aker, brian at tangent.org
http://krow.net/ <-- Me
http://tangent.org/ <-- Software
http://exploitseattle.com/ <-- Fun
You can't grep a dead tree.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the memcached