Webmasters Stack Exchange is a question and answer site for pro webmasters. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am looking for a simple locking daemon which listens for clients over TCP and processes locking requests.

I need to synchronize parallel PHP processes at MULTIPLE machines. E.g. one machine may say "I lock the 'abcd' identifier from now and until my death", and if the second machine says the same "lock 'abcd'", its request will be delayed until 'abcd' is released by the first machine. An identifier is also freed if obtaining process is accidently dies (when it dies, the disconnect happens, so locking daemon may process this disconnect as lock release).

Note that memcached add() is not so good in this case, because it cannot handle unexpected disconnects (it is important: process may die in many cases unexpectedly and without a chance to free the lock; also the lock cannot be freed by timeout, because some of processes works for a long time). I need a daemon which keeps opened connections and cares about them.

share|improve this question

closed as off topic by DisgruntledGoat, John Conde Nov 15 '10 at 14:19

Questions on Webmasters Stack Exchange are expected to relate to webmastering within the scope defined by the community. Consider editing the question or leaving comments for improvement if you believe the question can be reworded to fit within the scope. Read more about reopening questions here.If this question can be reworded to fit the rules in the help center, please edit the question.

Not sure how Stackexchange feels about cross-posts... you already asked this question here: serverfault.com/questions/201342/… – Zayne S Halsall Nov 13 '10 at 14:13
This belongs n serverfault. Since it is cross-posted I'll just close this one. – John Conde Nov 15 '10 at 14:19