tag proposal

Roy Lyseng Roy.Lyseng at Sun.COM
Tue Oct 9 13:47:57 UTC 2007



Todd Lipcon wrote:
> On Tue, 9 Oct 2007, Roy Lyseng 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 read up (or hope someone who knows better about this use of 
>>> memory barriers chimes in. It's not something I deal with much 
>>> outside of tracking down kernel bugs on SMP systems).
>>
>> Increments are generally not atomic. You have interfaces like 
>> atomic_inc_ulong() in Solaris 10 and in the Linux kernel (AFAIK).
> 
> In Linux there's /usr/include/asm/atomic.h which has:
> 
> void atomic_inc(atomic_t *v)
> 
> Not sure if it's supported on every last platform, though.
> 
> -Todd

My Linux box (RHEL based on 2.6.9) says that this is for the kernel only.

Roy


More information about the memcached mailing list