Tech moves fast! Stay ahead of the curve with Techopedia!
Join nearly 200,000 subscribers who receive actionable tech insights from Techopedia.
File locking is a data management feature that restricts other users from changing a specific file. This allows only one user or process access to this file at any given time. This is to prevent the problem of interceding updates on the same files.
For example, if process A and process B open the same file, process A then changes the file and saves it. Process B, which still has the original state file, makes some changes then saves it, rendering the changes made by process A lost.
The file locking mechanism was introduced by IBM in 1963 in mainframe computers that used the OS/360. At the time, it was called "exclusive control." This is a first-come, first-served method for file management in multiuser systems. The first process or user to access the file locks out other users from being able to access it. When the file has been updated and control has been relinquished, it becomes unlocked and available for others to access. Modern implementation of this method allows for multiple users to access the file but only the first one to access it may modify it. Some applications allow interceding updates with all the changes selectively merged later on, whether manually or automatically.