Lock

Lock – A shared-access storage system needs some way to ensure that multiple actors working on the same file or region of a file cannot conflict by writing data at the same time, with one write preventing or corrupting the other. A lock prevents this. Before writing, an application or process will obtain a lock, from the filesystem for example, on the area it intends to modify; the whole file or a portion of it. While the lock is held, no one else can write data to the locked area. Once the write is complete, the lock is relinquished. This puts a burden on the system to manage locks. The then necessary process of obtaining, checking for, and relinquishing locks adds latency to every write transaction.