In a multi-user environment, more than one user can change an RMSfile at the same time. This introduces some dangerous possibilities. If the proper precautions are not taken, two users could be trying to write to the same record at the same time. The end result of this attempt is unpredictable at best. To alleviate this problem, some sort of mutual exclusion mechanism must be used. This mechanism guarantees that only one user is writing to a record at a time.
RMS provides functions for mutual exclusion. These functions are not used by RMS directly, but can be called by your program to ensure mutual exclusion for updating actions on an RMSfile. You can perform locking and unlocking either at the file level or at the record level. These functions must be called by an application program to prevent simultaneous access by two separate programs in a multi-user environment. Only when an application will always be run in a single user environment can these functions be left out of the applications program.