Hello memcached !
My project is using memcached now, i wonder if memcached can add
LOCK/UNLOCK Command ?
grammer:
1. TRYLOCK intvar
if intvar == 0 then intvar++, return true
else return false
2. UNLOCK intvar
intvar--
3. LOCK intvar
if intvar == 0 then intvar++, return true
else begin
wait (in queue) until intvar is set to zero
intvar++
return true
end
EXPLANATION:
These commands will help memcached to support complex data operation. For
example:
I can store User's money and something he want to buy in two different items.
and
can both modify 'money' and 'something' in one time with LOCK/UNLOCK.
And we can simulate Structures in memcached with some tricks in client side.
--------------
skywind
2007-06-20