Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
File locking
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
{{Short description|Computer mechanism}} {{More citations needed|date=February 2015}} '''File locking''' is a mechanism that restricts access to a [[computer file]], or to a region of a file, by allowing only one [[user (computing)|user]] or [[computer process|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#Software|race condition]], by enforcing the serialization of update processes to any given file. The following example illustrates the interceding update problem: # [[computer process|Process]] A reads a customer [[database record|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 system]]s support the concept of [[record locking]], which means that individual records within any given file may be locked, thereby increasing the number of [[Concurrency (computer science)|concurrent]] update processes. Database maintenance uses file locking, whereby it can serialize access to the entire physical file underlying a database. 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. Poor use of file locks, like any computer [[Lock (computer science)|lock]], can result in poor performance or in [[Deadlock (computer science)|deadlock]]s. 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.
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)