Lesson plan
File locking
File locking is a mechanism that restricts access to a computer file, or to a region of a file, by allowing only one user or process to modify or delete it at a specific time, and preventing reading of the file while it's being modified or deleted. Systems implement locking to prevent an interceding update scenario, which is an example of a race condition, by enforcing the serialization of update processes to any given file. The following example illustrates the interceding update problem: # Process A reads a customer record from a file containing account information, including the customer's account balance and phone number. # Process B now reads the same record from the same file, so it has its own copy. # Process A changes the account balance in its copy of the customer record and writes the record back to the file. # 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 B has now written its stale account-balance value to the file, causing the changes made by process A to be lost. 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.…
Article summary
File locking is a mechanism that restricts access to a computer file, or to a region of a file, by allowing only one user or process to modify or delete it at a specific time, and preventing reading of the file while it's being modified or deleted. Systems implement locking to prevent an interceding update scenario, which is an example of a race condition, by enforcing the serialization of update processes to any given file. The following example illustrates the interceding update problem: # Process A reads a customer record from a file containing account information, including the customer's account balance and phone number. # Process B now reads the same record from the same file, so it has its own copy. # Process A changes the account balance in its copy of the customer record and writes the record back to the file. # 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 B has now written its stale account-balance value to the file, causing the changes made by process A to be lost. 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.…
Key claims
No claims recorded.
Discussion questions
- Summarise the article in your own words. Which single claim would you verify first, and why?
- Which claim in this article is most likely to be revised as the sources update? How would you check its current status?
- If two sources disagreed about one of these facts, what would you need in order to trust one over the other?
Bibliography
No sources recorded.
Key claims and bibliography are generated from the same tracked claims and sources as the article page.