File Locking Flashcards

1
Q

What is file locking?

A

File locking is a mechanism that restricts access to a computer file by allowing only one user or process to access it in a specific time.

For example, Alex reads a customer record from a file containing account information, including the customer’s account balance and phone number.

Joan at the other end of the office accesses and reads the same record from the same file and now has her own copy on her desktop.

Alex changes the account balance in his copy of the customer record and writes (saves) the record back to the file.

Joan still has the original value for the account balance in her copy of the customer record, updates the account balance and also writes the customer record back to the file.

Because Joan has now written the account-balance value to the file, this causes the changes made by Alex to be lost.
The data is now corrupted. Even if the customer
account balance is as it should be – there are at least two transactions on the account and the system is not functioning correctly.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

File locking cont.

A

Most operating systems support the concept of record/file locking, which means that individual records within any given file may be locked.

Poor use of file locks, like any computer lock, can result in poor performance or in deadlocks. 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.

You may have seen file locking in action when you try to access a file and a message appears saying the ‘This file is locked by ‘user’’. If a person who opens a file on machine A tries to open the same already open file on machine B – then this message would be generated.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly