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.