Ask Question

If we can lock a file, we can solve the race condition problem by locking a file during the check-and-use window, because no other process can use the file during the time window. Why don't we use this approach to solve the race condition problems discussed in this chapter?

+4
Answers (1)
  1. 20 September, 08:51
    0
    A file can only be locked out to other users or processes only if it's already open, meaning it's in use as a resource during the time window and therefore it's impossible solving the race condition problem by locking the file during the check-and-use window.

    Hence, during the check-and-use process, it's impossible to lock a file.

    In conclusion, any lock created can be ignored by the malicious process.
Know the Answer?
Not Sure About the Answer?
Find an answer to your question 👍 “If we can lock a file, we can solve the race condition problem by locking a file during the check-and-use window, because no other process ...” in 📗 Computers & Technology if the answers seem to be not correct or there’s no answer. Try a smart search to find answers to similar questions.
Search for Other Answers