<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">
Nice. Thanks for the tip earlier that brought this on :)<div><br class="webkit-block-placeholder"></div><div>So with every object having a 64 bit unique value, if I call gets, I retrieve a value for the object (unique value), then send memcache this old value (64 bit unique), new value (new update of object) and if the unique is still the same for object, it will push the change? <br><div contenteditable="false"> <span class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: auto; -khtml-text-decorations-in-effect: none; text-indent: 0px; -apple-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><br class="Apple-interchange-newline"><div><br class="khtml-block-placeholder"></div><div>Chris Goffinet</div><div><a href="mailto:goffinet@yahoo-inc.com">goffinet@yahoo-inc.com</a></div><div><br class="khtml-block-placeholder"></div><br class="Apple-interchange-newline"></span> </div><br><div><div>On Sep 8, 2007, at 12:27 AM, Dustin Sallings wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><br><span class="Apple-tab-span" style="white-space:pre">        </span>I just prototyped a pair of operations for implementing CAS in memcached. This provides atomic updates of arbitrary objects without having to rely on locks.<br><br><span class="Apple-tab-span" style="white-space:pre">        </span>The idea is that every object will have some unique 64-bit value that can be retrieved with a new command (I called it ``gets'' for some reason). This value needs to be unique and consistent for a given value within memcached. It can be a counter or memory address or whatever.<br><br><span class="Apple-tab-span" style="white-space:pre">        </span>After doing a ``gets'' for a key and getting a response, the client can manipulate the data structure as fit, and use a ``cas'' operation to put it back iff it has the same value as retrieved (based on the identifier). It returns a ``NOT FOUND'' error when there's no value for the key (and then you can try it with an ``add''), or ``EXISTS'' when the identifier does not match (and then you can try again from the ``gets'').<br><br><span class="Apple-tab-span" style="white-space:pre">        </span>Opinions?<br><br>-- <br>Dustin Sallings<br><br><br></blockquote></div><br></div></body></html>