oneinstance
oneinstance is a mechanism designed to guarantee that only a single running instance of an application exists on a system. It is used by desktop programs, services, and CLI tools to prevent conflicts over resources such as files, ports, or user interface focus.
Implementation typically relies on a cross-process lock. Common techniques include a lock file or PID file,
Behavior after detection varies by design. Some oneinstance implementations terminate the new process after notifying the
Design considerations include cross-platform compatibility, handling of stale locks after crashes, race conditions during startup, and
See also: single-instance application, singleton pattern, inter-process communication, lock file, mutex.