Comment #4 on issue 127 by [email protected]: incr/decr operations are not thread safe.
http://code.google.com/p/memcached/issues/detail?id=127

Err, I figured it out, but it's still slower and not entirely correct so we'll have
to figure it more later.

do_add_delta has the global cache_lock, so it should've never had a race condition? But the item that's passed into it is fetched from outside of the big lock. So an incremented item could end up being junked by another thread. Added a little bit to trond's patch to re-fetch the item once inside do_add_delta and the test came back 100% every time. It's still 7% slower, and I'm not sure if trond had that fixed
elsewhere in the engine branch. I couldn't find it on a cursory look.

To fix it more, do_add_delta needs to be passed in a key,keylen tuple instead of an item and return a NOT_FOUND if the internal fetch doesn't find the item. But again
we'll revisit it later :/

--
You received this message because you are listed in the owner
or CC fields of this issue, or because you starred this issue.
You may adjust your issue notification preferences at:
http://code.google.com/hosting/settings


--
To unsubscribe, reply using "remove me" as the subject.

Reply via email to