Mutual exclusion prevents competing operations on different nodes from proceeding simultaneously. In an Erlang cluster, :global provides arbitrarily named locks: after one process acquires a lock, no other process in the cluster can acquire it until release. section 12.1.5
A lock is identified by a resource term and a requester ID. Using the process ID as the requester normally limits ownership to one process. Acquisition communicates with other nodes; callers can wait indefinitely or configure a waiting limit. :global.trans/2 packages acquisition, execution, and release into one operation. section 12.1.5
Serialize work across two nodes
Acquire {:some_resource, self()} with :global.set_lock/1 on node1. A matching request on node2 waits until node1 calls :global.del_lock/1. For the acquire-release pattern, wrap the work with :global.trans/2.
Global registration uses the same mechanism internally: it locks the alias, checks whether it is already registered, informs all nodes, and releases the lock. This coordination creates inter-node message traffic, so locking is generally something to avoid when another design can provide the required behavior. section 12.1.3 section 12.1.5

















