File locking may also refer to additional security applied by a computer user either by using Windows security, NTFS permissions or by installing a third party file locking software. Poor use of file locks, like any computer lock, can result in poor performance or in deadlocks. Although this does prevent any other process from accessing the file, it can be more efficient than individually locking many regions in the file by removing the overhead of acquiring and releasing each lock. Database maintenance uses file locking, whereby it can serialize access to the entire physical file underlying a database. Most operating systems support the concept of record locking, which means that individual records within any given file may be locked, thereby increasing the number of concurrent update processes. Process B has now written its stale account-balance value to the file, causing the changes made by process A to be lost.Process B, which still has the original stale value for the account balance in its copy of the customer record, updates the account balance and writes the customer record back to the file.Process A changes the account balance in its copy of the customer record and writes the record back to the file.Process B now reads the same record from the same file, so it has its own copy.Process A reads a customer record from a file containing account information, including the customer's account balance and phone number. The following example illustrates the interceding update problem: Systems implement locking to prevent the classic interceding update scenario, which is a typical example of a race condition, by enforcing the serialization of update processes to any given file.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. Archives
December 2022
Categories |