atomic get-then-delete command
conspyre at gmail.com
Wed Apr 20 12:16:12 PDT 2005
I'm completely new to memcached (and I'm happy to report that I've had
no problems getting everything up-and-running). I know protocols
aren't something one extends on a whim, but I was wondering if the
addition of an atomic 'get-then-delete' command has ever been bandied
about by anyone here. I would use such a command (which I refer to as
a "consume" command) for memcached-based queues in order to implement
non-persistent Linda/tuplespace/distributed computing patterns.
My question is: Is such a command a bad idea for any reason? I ask
because I cloned and then frankensteined the handler for the "get"
command in memcached.c to create such a beast and it seems to be
working okay thus far -- but I haven't programmed in C in nearly a
dozen years and don't know the memcache code, so I'm certain that it's
not a commercial-grade mod. However, it would seem to me that, because
of the singled-threaded nature of memcached, it shouldn't a risky
proposition. Am I wrong?
Apologies for adding even more mail to your inbox,
More information about the memcached