Next | Prev | Up | Top | Contents | Index
Overview of File and Record Locking
Mandatory and advisory file and record locking are available on many current releases of the UNIX operating system. The intent of these capabilities is to provide a synchronization mechanism for programs accessing the same stores of data simultaneously. Such processing is characteristic of many multiuser applications, and the need for a standard method of dealing with the problem has been recognized by standards advocates like /usr/group, an organization of UNIX system users from businesses and campuses across the country.
Advisory file and record locking can be used to coordinate independent, unrelated processes. In mandatory locking, on the other hand, the standard I/O subroutines and I/O system calls enforce the locking protocol. In this way, at the cost of a little efficiency, mandatory locking double-checks the programs to avoid accessing the data out of sequence.
The engineering reference data for record locking is found in the fcntl(2), lockf(3), and fcntl(5) reference pages. You may want to skim those pages before continuing.
- Terminology
-
Next | Prev | Up | Top | Contents | Index