Using File and Record Locking

To lock the file elements, you can use the light weight synchronization mechanisms that are described in Multithreaded Programming Guide with mapped files.

Locking files prevents errors that can occur when several users try to update a file at the same time. You can lock a portion of a file.

File locking blocks access to an entire file. Record locking blocks access to a specified segment of the file. In Oracle Solaris, all files are a sequence of bytes of data: a record is a concept of the programs that use the file.