i agree with client built into it but let's think memcached like a nosql server key-value but like a sql server we can implement locks with a key-value like we can implement locks... it's just a function over existent structure, don't need modifications and it's (memcached) very fast i think for a global locker daemon we could implement it at memcached
since a lock is just a key-value managed by a diferent fuction (LOCK) we can use others function with that key-value (GET, SET, ADD, DELETE, etc) another interesting idea was replication (repcache) and non volatile memory (memcachedb) with these three ideas we can have a very very good nosql server (it's not a sql server yet, but it's very good) check that for a global locker (cluster) we don't have good implementations (nfs have a locker daemon, some others file system have, but a generic locker daemon don't exist (google answered to me hehehe)) would be nice put it at core level and clients CAS was not a core feature, but it's very nice to have CAS at server side... why not a LOCK function? it's easy to implement... just LOCK or UNLOCK no more options, key-value based, key=lock name, value = client name, if <key> exists = locked for client <value>, if <key> not exists = unlocked, just DELETE(UNLOCK) <key>-<value> can delete the key, or timeout can delete it too... see that we will have a new delete option... (SQL like): delete key=sent_key where value=sent_value, (today) delete key=sent_key too function to implement: LOCK (create a key-value, always return value) UNLOCK (delete key-value, if key-value=sent(key-value) delete, return before delete value, if not exist return blank or null) that's it easy not? timeout could work too (it's key-value based) 2011/2/4 Adam Lee <[email protected]>: > sure, latency would be lower, but i still believe that they would be > functionally identical. > > regardless, i believe that this isn't really something that memcached should > do. it gives you the tools necessary to implement it without adding > functionality tangential to its core purpose. if you want a more robust > distributed locking mechanism, then you can use a tool that was > purpose-built for this. > > i'm a firm believer in keeping systems to their core design, otherwise > memcached will eventually have an email client built into it. > > -- > awl > > On Feb 3, 2011 11:11 PM, "Roberto Spadim" <[email protected]> wrote: > -- Roberto Spadim Spadim Technology / SPAEmpresarial
