Chapter 5. File Locking

If you were in the business of selling a piano on consignment, then you would only make a profit if you could sell the piano for more than the owner required for it. However, if the owner kept raising the price of his piano every time you had a buyer for it, then you'd soon have to give up selling it or lose money on the sale.

Working with data records within a file of a multi-processing system can present the same challenge. If one process must update records while another process is doing the same, then some form of coordination is required to prevent chaos. One UNIX solution to this problem is the file locking facility.

In this chapter, you will learn about

  • Lock files

  • Advisory locking

  • Applying region locks

  • Mandatory locking

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.142.156.202