Locking 4.14 Using File and Record Locking As stated before, RMS does not guarantee accuracy of multiple changes to an RMSfile by several users when locking is not used. If a program will be operating in a multi-user environment where some of the users are working with the same RMSfiles, the program should issue calls to the file or record locking routines to ensure data consistency. A deadlock situation occurs when two or more processes are competing for a limited set of resources. For example, if a program has a record locked, it is assumed that at some point the program will unlock the record.
Deadlocks occur when two or more programs are waiting to lock something.
The simplest case involves two programs. Since the file is locked, the first program waits for the file to be unlocked. Neither program will ever continue because both are waiting. The above scenario can apply to any mixture of file and record locking. Because this condition is so easy to create, most systems that provide locking mechanisms also perform deadlock detection.