Reply to comment


Sylvain's picture

It's not possible: memcached operations are atomic, and the contract of add() is to fail if there's already a value for that key.

So if two processes send add("lock:xyz", "1") to a given memcached server at the same time, requests will be serialized internally by memcached: one will succeed an the other will fail.

See also http://code.google.com/p/memcached/wiki/FAQ#Is_memcached_atomic?

Reply

The content of this field is kept private and will not be shown publicly. If you have a Gravatar account, used to display your avatar.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.
  • Web page addresses and e-mail addresses turn into links automatically.

More information about formatting options

CAPTCHA
Please answer this question to show that you're not a stupid spam robot.
5 + 1 =
Solve this simple math problem and enter the result. E.g. for 1+3, enter 4.

J'ai Failli Attendre