Can I require for some new features -- Lock / Unlock Command

skywind skywind3000 at 163.com
Wed Jun 20 09:01:04 UTC 2007


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




More information about the memcached mailing list