BrLock features a distributed lock, using the algorithm Carvalho and Roucariol, On mutual exclusion in computer networks, ACM Communications, Feb83.

The algorithm features minimal messages for acquiring the next lock, but with the trade-off of network being reliable enough to ensure that all nodes are alive. In fact, one node won't be able to acquire the next lock if it can't communicate to all other nodes (unless the node which was the last one to acquire the lock).

If this is a hard constraint for you, you may want to use IPC::Lock.

The list containing all nodes that may apply for this lock must be described in the configuration file passed as parameters to the environment builder (see SYNOPSIS). The file must be as this:

0 0
0.0.0.0 0
x.x.x.x port
y.y.y.y port
...

The first line must have two zeros, and the second must have the 0.0.0.0 ip and the 0 port (deprecated parameters, see TODO). The next lines must have a node ip and a node port. All nodes must use the same configuration file, so a node will read its own parameters.